Filter out RPITITs in astconv when checking for missing associated types
This commit is contained in:
parent
24c0b81c1f
commit
b2f3198608
@ -1440,6 +1440,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
tcx.associated_items(pred.def_id())
|
||||
.in_definition_order()
|
||||
.filter(|item| item.kind == ty::AssocKind::Type)
|
||||
.filter(|item| tcx.opt_rpitit_info(item.def_id).is_none())
|
||||
.map(|item| item.def_id),
|
||||
);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
||||
--> $DIR/issue-102140.rs:23:22
|
||||
--> $DIR/issue-102140.rs:26:22
|
||||
|
|
||||
LL | MyTrait::foo(&self)
|
||||
| ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
|
||||
@ -13,7 +13,7 @@ LL + MyTrait::foo(self)
|
||||
|
|
||||
|
||||
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
||||
--> $DIR/issue-102140.rs:23:9
|
||||
--> $DIR/issue-102140.rs:26:9
|
||||
|
|
||||
LL | MyTrait::foo(&self)
|
||||
| ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
|
||||
@ -21,7 +21,7 @@ LL | MyTrait::foo(&self)
|
||||
= help: the trait `MyTrait` is implemented for `Outer`
|
||||
|
||||
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
||||
--> $DIR/issue-102140.rs:23:9
|
||||
--> $DIR/issue-102140.rs:26:9
|
||||
|
|
||||
LL | MyTrait::foo(&self)
|
||||
| ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
|
33
tests/ui/impl-trait/in-trait/issue-102140.next.stderr
Normal file
33
tests/ui/impl-trait/in-trait/issue-102140.next.stderr
Normal file
@ -0,0 +1,33 @@
|
||||
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
||||
--> $DIR/issue-102140.rs:26:22
|
||||
|
|
||||
LL | MyTrait::foo(&self)
|
||||
| ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
help: consider removing the leading `&`-reference
|
||||
|
|
||||
LL - MyTrait::foo(&self)
|
||||
LL + MyTrait::foo(self)
|
||||
|
|
||||
|
||||
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
||||
--> $DIR/issue-102140.rs:26:9
|
||||
|
|
||||
LL | MyTrait::foo(&self)
|
||||
| ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
|
||||
|
|
||||
= help: the trait `MyTrait` is implemented for `Outer`
|
||||
|
||||
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
||||
--> $DIR/issue-102140.rs:26:9
|
||||
|
|
||||
LL | MyTrait::foo(&self)
|
||||
| ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
|
||||
|
|
||||
= help: the trait `MyTrait` is implemented for `Outer`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
@ -1,3 +1,6 @@
|
||||
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
||||
// revisions: current next
|
||||
|
||||
#![feature(return_position_impl_trait_in_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user