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
implied bounds from impl header are not used when comparing trait and impl methods #105495
traitTrait{fnget();}impl<'a,'b>Traitfor&'a&'b(){// There is an implied bound 'b: 'afnget()where'b:'a,{}//~^ ERROR impl has stricter requirements than trait}
Although it should for the same reason it compiles with the following change:
- impl<'a, 'b> Trait for &'a &'b () {+ impl<'a, 'b> Trait for &'a &'b () where 'b: 'a, {
There should be no difference in behavior between implied and explicit bounds on impl header.
This is because we're not adding sufficient implied bounds in compare_predicate_entailment() here:
Activity
aliemjay commentedon Dec 9, 2022
This should be fixed for associated types as well:
aliemjay commentedon Mar 19, 2023
another test case:
fmease commentedon Dec 29, 2024
CC related (?): #89236 (but: inherent impl, not trait impl; wf'ck'ing (?) array repeat exprs, not compare_impl_item).