Repository navigation
TAIT: it's possible to impl a trait for a tait by using projections #99840
Description
Activity
- addedF-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
on Jul 28, 2022 The two commented out lines do not cause any errors (https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=8366951aa5afd218745dd0ebc4564387) So I'd say this is unsound or at least causes ICEs: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=07fbbfb3b0ecc1dc59ffc71b18b06f1e
- addedI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Jul 28, 2022 what, is that a recent regression? :o these do error with
rustc 1.63.0-nightly (5435ed691 2022-06-07)- addedI-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundnessrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
on Jul 28, 2022 - addedE-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
on Jul 28, 2022 Hmm... that one got reverted in #99079
Was that a revert, or a targeted fix for closures ?
revert + actual fix of the original issue
The behavior is the same on master, no errors + ICEs. I'll try to manually bisect within the rollup to confirm cargo-bisect-rustc's findings.
Isn't this just another form of #99554?
Isn't this just another form of #99554?
no, #99554 is using projections in ways which should fail the orphan check, here we have projections which should pass the orphan check, but can be normalized to opaque types.
These issues need two distinct fixes
the fix for this being: add tests for auto trait stuff with opaque types but allow them in impls. As coherence doesn't use
Reveal::All, having one impl trait ref withimpl A<X, opaque, Y> for Zshould conflict with allimpl A<X, whatever, Y> for Z. Have to think more about this thoughI have a proper fix locally, but we should investigate how #99383 affected this
- removedE-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
on Jul 29, 2022 (I wish we had try builds for each rolled up PR 😅) It was indeed introduced in the same rollup: by eecfdfb / #99383.
Reverting that does indeed bring the conflicting implementation errors back, and fixes the ICE.
Although it looks suspicious this is not caused by #99383 I reverted all changes made by it and tested it, this still passes without any errors. Here https://github.com/ouz-a/rust/tree/undo_formalize
- added 4 commits that reference this issue
on Nov 22, 2022 - Repository owner moved this from In Progress to Done in type alias impl trait stabilization
on Nov 23, 2022 - added a commit that references this issue
on Dec 1, 2022
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
As coherence checking keeps opaque types opaque this should not be unsound. Considering that a direct impl for opaque types is forbidden, this is an inconsistency we should resolve though.
cc @oli-obk