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
While investigating rust-lang/rust#112583, it seems that it reveals a bug in the new solver rather than being fixed by it. The new solver accepts this:
It uses the impl candidate for normalization instead of the ParamEnv candidate.
This means that we're using a different candidate when solving T: Trait than when normalizing <T as Trait>::Ty. I don't think it is unsound but it can lead to some surprising behavior like this requiring 'a == 'static despite using the impl candidate for normalization:
traitTrait<'a>{typeTy;}impl<T>Trait<'_>forT{typeTy = ();}fntest<'a,T:Trait<'static>>(){let _: <TasTrait<'a>>::Ty = ();//~^ ERROR lifetime may not live long enough}
The text was updated successfully, but these errors were encountered:
While investigating rust-lang/rust#112583, it seems that it reveals a bug in the new solver rather than being fixed by it. The new solver accepts this:
It uses the impl candidate for normalization instead of the ParamEnv candidate.
This means that we're using a different candidate when solving
T: Trait
than when normalizing<T as Trait>::Ty
. I don't think it is unsound but it can lead to some surprising behavior like this requiring'a == 'static
despite using the impl candidate for normalization:The text was updated successfully, but these errors were encountered: