-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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.S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.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
This doesn't compile although it should
struct Equal<'a, 'b>(&'a &'b (), &'b &'a ()); // implies 'a == 'b
trait Trait { type Ty; }
impl<'x> Trait for Equal<'x, 'x> { type Ty = (); }
fn test<'a, 'b>(_: (<Equal<'a, 'b> as Trait>::Ty, Equal<'a, 'b>)) {}
//~^ ERROR lifetime may not live long enough
It compiles with this trivial change:
- fn test<'a, 'b>(_: (<Equal<'a, 'b> as Trait>::Ty, Equal<'a, 'b>)) {}
+ fn test<'a, 'b>(_: <Equal<'a, 'b> as Trait>::Ty, _: Equal<'a, 'b>) {}
@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.S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.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.