Open
Description
Here is an inconsistency in behavior between wfcheck and borrowck:
trait Trait { type Ty; }
impl<T> Trait for T { type Ty = (); }
// borrowck is able to assume `T: 'static`:
fn pass<T>(_: <&'static T as Trait>::Ty) { None::<&'static T>; }
// ... while wfcheck can't:
fn fail<T>(_: <&'static T as Trait>::Ty) where &'static T: Sized, {}
//~^ ERROR the parameter type `T` may not live long enough
#100989 Introduced this. I think the intent was to restrict implied bounds from impl headers only, not fn signatures. Cc @lcnr.
@rustbot label C-bug T-types A-implied-bounds