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
This doesn't compile:
Although it should for the same reason it compiles with the following change:
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:rust/compiler/rustc_hir_analysis/src/check/compare_method.rs
Line 252 in 14ca83a
@rustbot label T-types A-implied-bounds A-associated-items C-bug