You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
coherence incorrectly considers unnormalizable_projection: Trait to not hold even if it could #114061
// crate deptraitIsUnit{}implIsUnitfor(){}pubtraitWithAssoc<'a>{typeAssoc;}// The two impls of `Trait` overlappubtraitTrait{}impl<T>TraitforTwhereT:'static,for<'a>T:WithAssoc<'a>,for<'a> <TasWithAssoc<'a>>::Assoc:IsUnit,{}impl<T>TraitforBox<T>{}// root crateuse dep::*;structLocal;implWithAssoc<'_>forBox<Local>{typeAssoc = ();}fnimpls_trait<T:Trait>(){}fnmain(){impls_trait::<Box<Local>>();}
During coherence for<'a> <Box<T> as WithAssoc<'a>>::Assoc: IsUnit is considered to not hold.
This allows overlapping impls in coherence which is generally considered to be unsound™.
Coherence considers the impls to be disjoint because for<'a> <Box<T> as WithAssoc<'a>>::Assoc: IsUnit, does not hold. When trying to normalize <Box<T> as WithAssoc<'a>>::Assoc ends up ambiguous, we keep the projection around. Coherence then considers for<'a> <Box<T> as WithAssoc<'a>>::Assoc: IsUnit to not have any impl as IsUnit is a local trait.
Activity
lcnr commentedon Oct 2, 2023
lcnr commentedon Oct 9, 2023
figure out why this detects overlap in the new solver, it is strongly related to #99554
19 remaining items
Auto merge of rust-lang#121848 - lcnr:stabilize-next-solver, r=compil…
Auto merge of rust-lang#121848 - lcnr:stabilize-next-solver, r=<try>
Auto merge of rust-lang#121848 - lcnr:stabilize-next-solver, r=<try>
Auto merge of rust-lang#121848 - lcnr:stabilize-next-solver, r=<try>
Auto merge of rust-lang#121848 - lcnr:stabilize-next-solver, r=compil…
Auto merge of #121848 - lcnr:stabilize-next-solver, r=compiler-errors
Auto merge of rust-lang#130654 - lcnr:stabilize-coherence-again, r=<try>
Auto merge of #121848 - lcnr:stabilize-next-solver, r=compiler-errors
Auto merge of rust-lang#130654 - lcnr:stabilize-coherence-again, r=<try>
Auto merge of rust-lang#130654 - lcnr:stabilize-coherence-again, r=<try>
Auto merge of rust-lang#130654 - lcnr:stabilize-coherence-again, r=co…
Auto merge of #130654 - lcnr:stabilize-coherence-again, r=compiler-er…