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
traitMk{typeAssoc;}fnmk<T:Mk>(t:T) -> T::Assoc{todo!()}fnfoo<S:Mk + Default>(){let x = Default::default();let y = mk::<_/* ?z */>(x);let x:S = x;}
error[E0282]: type annotations needed for `<_ as Mk>::Assoc`
--> <source>:11:9
|
11 | let y = mk::<_ /* ?z */>(x);
| ^
|
help: consider giving `y` an explicit type, where the type for associated type `<_ as Mk>::Assoc` is specified
|
11 | let y: <_ as Mk>::Assoc = mk::<_ /* ?z */>(x);
| ++++++++++++++++++
lcnr
changed the title
Alias-eq is weaker than just subst-relate for "rigid" associated types
alias-eq is weaker than just subst-relate for "rigid" associated types
Apr 14, 2023
This compiles on stable by constraining for<'a> fn(<_ as Trait<'a>>::Assoc) to for<'a> fn(<T as Trait<'a>>::Assoc) because we simply relate the substs of projections which we cannot normalize (and which are inside of binders, as we otherwise replace them with inference vars).
This inference behavior will change with the new solver which may break stable code.
Related, heavily reduced from an example in syn:
The text was updated successfully, but these errors were encountered: