-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)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
This doesn't compile:
trait Trait {
fn get();
}
impl<'a, 'b> Trait for &'a &'b () { // There is an implied bound 'b: 'a
fn get() 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:
let mut wf_tys = FxIndexSet::default(); |
@rustbot label T-types A-implied-bounds A-associated-items C-bug
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)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.