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(
202
202
missing_items : & [ ty:: AssocItem ] ,
203
203
full_impl_span : Span ,
204
204
) {
205
+ let missing_items =
206
+ missing_items. iter ( ) . filter ( |trait_item| tcx. opt_rpitit_info ( trait_item. def_id ) . is_none ( ) ) ;
207
+
205
208
let missing_items_msg = missing_items
206
- . iter ( )
209
+ . clone ( )
207
210
. map ( |trait_item| trait_item. name . to_string ( ) )
208
211
. collect :: < Vec < _ > > ( )
209
212
. join ( "`, `" ) ;
Original file line number Diff line number Diff line change 1
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:1 :12
2
+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:4 :12
3
3
|
4
4
LL | #![feature(return_position_impl_trait_in_trait)]
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(return_position_impl_trait_in_trait)]
8
8
= note: `#[warn(incomplete_features)]` on by default
9
9
10
10
error[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
12
12
|
13
13
LL | fn foo(&self) -> impl Sized;
14
14
| ---------------------------- `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
+
1
4
#![ feature( return_position_impl_trait_in_trait) ]
2
5
//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete
3
6
@@ -7,7 +10,7 @@ trait MyTrait {
7
10
}
8
11
9
12
impl MyTrait for i32 {
10
- //~^ ERROR not all trait items implemented, missing: `foo`
13
+ //~^ ERROR not all trait items implemented, missing: `foo`
11
14
fn bar ( & self ) -> impl Sized {
12
15
self . foo ( )
13
16
}
You can’t perform that action at this time.
0 commit comments