-
Notifications
You must be signed in to change notification settings - Fork 0
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
opaque auto trait leakage in coherence #65
Comments
20 tasks
This can never happen currently because we always hit ambiguity when normalizing a TAIT during candidate assembly. We probably should protect against it regardless, but I don't think we have any tests that are unsound currently. I couldn't think of a more creative test than this tho: #![feature(type_alias_impl_trait)]
mod foo {
type Tait = impl Sized;
pub struct Wrapper(Tait);
fn test() -> Tait { std::ptr::null_mut::<()>() }
}
trait Foo {}
impl<T: Send> Foo for T {}
impl Foo for foo::Wrapper {}
//~^ ERROR conflict implementations of trait `Foo` for type `Wrapper` |
closing due to rust-lang/rust#116689 |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Oct 14, 2023
…compiler-errors explicitly handle auto trait leakage in coherence does not impact behavior but may avoid weird bugs in the future, cc rust-lang/trait-system-refactor-initiative#65 r? `@compiler-errors`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Oct 14, 2023
…compiler-errors explicitly handle auto trait leakage in coherence does not impact behavior but may avoid weird bugs in the future, cc rust-lang/trait-system-refactor-initiative#65 r? ``@compiler-errors``
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 14, 2023
Rollup merge of rust-lang#116689 - lcnr:auto-trait-hidden-ty-leak, r=compiler-errors explicitly handle auto trait leakage in coherence does not impact behavior but may avoid weird bugs in the future, cc rust-lang/trait-system-refactor-initiative#65 r? ``@compiler-errors``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
we should add tests that we don't leak auto traits of opaques in coherence and update the impl to make sure that we don't
The text was updated successfully, but these errors were encountered: