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
// When we're solving `<T as Foo>::Assoc = i32`, we actually first solve// `<T as Foo>::Assoc = ?1t`, then unify `?1t` with `i32`. That goal// with the inference variable is ambiguous when there are >1 param-env// candidates.// We don't unify the RHS of a projection goal eagerly when solving, both// for caching reasons and partly to make sure that we don't make the new// trait solver smarter than it should be.// This is (as far as I can tell) a forwards-compatible decision, but if you// make this test go from fail to pass, be sure you understand the implications!traitFoo{typeAssoc;}traitBar{}impl<T>BarforTwhereT:Foo<Assoc = i32>{}fnneeds_bar<T:Bar>(){}fnfoo<T:Foo<Assoc = i32> + Foo<Assoc = u32>>(){needs_bar::<T>();//~^ ERROR type annotations needed: cannot satisfy `T: Bar`}fnmain(){}
Feels pretty desirable to me and is backcompat to change later. Keeps the existing behavior of the old solver. We do this by replacing the expected term of NormalizesTo goals with inference variables before evaluating the QueryInput. This means that inside of the goal, the actual expected type is unknowable.
The text was updated successfully, but these errors were encountered:
Feels pretty desirable to me and is backcompat to change later. Keeps the existing behavior of the old solver. We do this by replacing the expected term of
NormalizesTo
goals with inference variables before evaluating theQueryInput
. This means that inside of the goal, the actual expected type is unknowable.The text was updated successfully, but these errors were encountered: