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
Due to increased strictness in the checks performed by rustc in trait resolution, we had to specialize the extern_spec for Option. Otherwise, we would have an issue where the ParamEnv would contain a constraint of the form:
T : DeepModel<DeepModelTy = T::DeepModelTy>
which causes rustc to get very unhappy with us.
This appears due to the manner we extend the ParamEnv for functions with "inherited extern contracts" where we instantiate and concatenate their parameter environments. If during ParamEnv construction we throw away trivial constraints, (aka this one), we should be good.
It's actually rather a matter of transforming this constraint into T: DeepModel. This constraint actually tells something, we should not drop it!
YEs, what's not said here is that there is already another T : DeepModel constraint in this environment so we should be able to throw out the problematic one.
Due to increased strictness in the checks performed by
rustc
in trait resolution, we had to specialize theextern_spec
forOption
. Otherwise, we would have an issue where theParamEnv
would contain a constraint of the form:T : DeepModel<DeepModelTy = T::DeepModelTy>
which causes rustc to get very unhappy with us.
This appears due to the manner we extend the
ParamEnv
for functions with "inherited extern contracts" where we instantiate and concatenate their parameter environments. If duringParamEnv
construction we throw away trivial constraints, (aka this one), we should be good.ref: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Unexpected.20trait.20resolution.20failure
The text was updated successfully, but these errors were encountered: