This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +31
-4
lines changed
compiler/rustc_hir_analysis/src/check
tests/ui/impl-trait/in-trait Expand file tree Collapse file tree 4 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -202,8 +202,11 @@ fn missing_items_err(
202202 missing_items : & [ ty:: AssocItem ] ,
203203 full_impl_span : Span ,
204204) {
205+ let missing_items =
206+ missing_items. iter ( ) . filter ( |trait_item| tcx. opt_rpitit_info ( trait_item. def_id ) . is_none ( ) ) ;
207+
205208 let missing_items_msg = missing_items
206- . iter ( )
209+ . clone ( )
207210 . map ( |trait_item| trait_item. name . to_string ( ) )
208211 . collect :: < Vec < _ > > ( )
209212 . join ( "`, `" ) ;
Original file line number Diff line number Diff line change 11warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2- --> $DIR/dont-project-to-rpitit-with-no-value.rs:1 :12
2+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:4 :12
33 |
44LL | #![feature(return_position_impl_trait_in_trait)]
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(return_position_impl_trait_in_trait)]
88 = note: `#[warn(incomplete_features)]` on by default
99
1010error[E0046]: not all trait items implemented, missing: `foo`
11- --> $DIR/dont-project-to-rpitit-with-no-value.rs:9 :1
11+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:12 :1
1212 |
1313LL | fn foo(&self) -> impl Sized;
1414 | ---------------------------- `foo` from trait
Original file line number Diff line number Diff line change 1+ warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:4:12
3+ |
4+ LL | #![feature(return_position_impl_trait_in_trait)]
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+ |
7+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
8+ = note: `#[warn(incomplete_features)]` on by default
9+
10+ error[E0046]: not all trait items implemented, missing: `foo`
11+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:12:1
12+ |
13+ LL | fn foo(&self) -> impl Sized;
14+ | ---------------------------- `foo` from trait
15+ ...
16+ LL | impl MyTrait for i32 {
17+ | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
18+
19+ error: aborting due to previous error; 1 warning emitted
20+
21+ For more information about this error, try `rustc --explain E0046`.
Original file line number Diff line number Diff line change 1+ // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
2+ // revisions: current next
3+
14#![ feature( return_position_impl_trait_in_trait) ]
25//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete
36
@@ -7,7 +10,7 @@ trait MyTrait {
710}
811
912impl MyTrait for i32 {
10- //~^ ERROR not all trait items implemented, missing: `foo`
13+ //~^ ERROR not all trait items implemented, missing: `foo`
1114 fn bar ( & self ) -> impl Sized {
1215 self . foo ( )
1316 }
You can’t perform that action at this time.
0 commit comments