-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-implied-boundsArea: Implied bounds / inferred outlives-boundsArea: Implied bounds / inferred outlives-boundsC-bugCategory: This is a bug.Category: This is a bug.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
A-implied-boundsArea: Implied bounds / inferred outlives-boundsArea: Implied bounds / inferred outlives-boundsC-bugCategory: This is a bug.Category: This is a bug.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.