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
traitTrait<T>{typeAssoc: ?Sized;}implTrait<u32>foru32{typeAssoc = u16;}// This would trigger the check for overlap between automatic and custom impl// They actually don't overlap so an impl like this should remain possible// forever.//// impl Trait<u64> for dyn Trait<u32, Assoc = u32> {// type Assoc = dyn Trait<u32, Assoc = u32>;// }traitIndirect<T: ?Sized>{}implIndirect<dynTrait<u32,Assoc = u32>>for(){}impl<T: ?Sized>Trait<u64>forTwhere():Indirect<T>,{typeAssoc = dynTrait<u32,Assoc = u32>;}fnyay<T:Trait<U> + ?Sized,U>(x:&'static T) -> &'static <TasTrait<U>>::Assoc{todo!();}fnunconstrained<T>() -> T{todo!()}fnshould_be_ambig(){let y:&'static dynTrait<u32,Assoc = u32> = unconstrained();let _ = yay::<dynTrait<u32,Assoc = u32>,_>(y);// The current solver incorrectly constrains `_` to `u32` here.}fnmain(){let y:&'static dynTrait<u32,Assoc = u32> = unconstrained();// let mut x = yay::<_, u64>(y); // compilesletmut x = yay::<_,_>(y);// errors
x = y;}
This example works on stable but will break with the new solver.
The text was updated successfully, but these errors were encountered:
rust-lang/rust#107887
This example works on stable but will break with the new solver.
The text was updated successfully, but these errors were encountered: