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
{{ message }}
Repository navigation
rustc doesn't check nested WFness if it's in a higher-ranked predicate #162200
We should recurse on W<'a, T> and see T: Bound must hold, but we don't even recurse on the self arg of the predicate because the trait has escaping bound vars.
That regression list sucks. I think this is something we should consider slowly moving towards error (or at least deny-by-default) by starting with a warn-by-default lint.
I'm also curious if there's a good MCVE for things that are so "obvious" as the example above. This modification, for example, is pretty clear what the problem is when trying to call wf:
use std::fmt::Debug;traitBound{}structW<'a,T:Bound>(&'aT);fnwf<T>()wherefor<'a>W<'a,T>:Debug{}fnmain(){wf::<u32>();}
But, I could imagine that we can have move subtle things we don't check in e.g. super trait bounds. These could be good candidates to also move towards erroring quicker.
For where-clauses this check happens during item wf checking, could we FCW on these missing bounds? I think implying T: Bound here is undesirable and if we start the FCW we'll likely be in a fairly good spot once we actually want to finish the hr-implied bounds work
Activity
compiler-errors commentedon Apr 8, 2024
Minimal I think:
We should recurse on
W<'a, T>and seeT: Boundmust hold, but we don't even recurse on the self arg of the predicate because the trait has escaping bound vars.jackh726 commentedon Apr 11, 2024
That regression list sucks. I think this is something we should consider slowly moving towards error (or at least deny-by-default) by starting with a warn-by-default lint.
I'm also curious if there's a good MCVE for things that are so "obvious" as the example above. This modification, for example, is pretty clear what the problem is when trying to call
wf:But, I could imagine that we can have move subtle things we don't check in e.g. super trait bounds. These could be good candidates to also move towards erroring quicker.
lcnr commentedon Jul 25, 2025
For where-clauses this check happens during item wf checking, could we FCW on these missing bounds? I think implying
T: Boundhere is undesirable and if we start the FCW we'll likely be in a fairly good spot once we actually want to finish the hr-implied bounds work