-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TAIT: it's possible to impl a trait for a tait by using projections #99840
Comments
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 |
what, is that a recent regression? :o these do error with |
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? |
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 |
I have a proper fix locally, but we should investigate how #99383 affected this |
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 |
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? `@lcnr` fixes rust-lang#99840
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ``@lcnr`` fixes rust-lang#99840
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ```@lcnr``` fixes rust-lang#99840
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes rust-lang#99840
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
The text was updated successfully, but these errors were encountered: