File tree Expand file tree Collapse file tree 4 files changed +36
-4
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting
tests/ui/async-await/in-trait Expand file tree Collapse file tree 4 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -420,6 +420,7 @@ fn suggest_restriction<'tcx>(
420420) {
421421 if hir_generics. where_clause_span . from_expansion ( )
422422 || hir_generics. where_clause_span . desugaring_kind ( ) . is_some ( )
423+ || projection. map_or ( false , |projection| tcx. opt_rpitit_info ( projection. def_id ) . is_some ( ) )
423424 {
424425 return ;
425426 }
Original file line number Diff line number Diff line change 11warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2- --> $DIR/missing-send-bound.rs:3 :12
2+ --> $DIR/missing-send-bound.rs:5 :12
33 |
44LL | #![feature(async_fn_in_trait)]
55 | ^^^^^^^^^^^^^^^^^
@@ -8,19 +8,19 @@ LL | #![feature(async_fn_in_trait)]
88 = note: `#[warn(incomplete_features)]` on by default
99
1010error: future cannot be sent between threads safely
11- --> $DIR/missing-send-bound.rs:15 :20
11+ --> $DIR/missing-send-bound.rs:17 :20
1212 |
1313LL | assert_is_send(test::<T>());
1414 | ^^^^^^^^^^^ future returned by `test` is not `Send`
1515 |
1616 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
1717note: future is not `Send` as it awaits another future which is not `Send`
18- --> $DIR/missing-send-bound.rs:11 :5
18+ --> $DIR/missing-send-bound.rs:13 :5
1919 |
2020LL | T::bar().await;
2121 | ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
2222note: required by a bound in `assert_is_send`
23- --> $DIR/missing-send-bound.rs:19 :27
23+ --> $DIR/missing-send-bound.rs:21 :27
2424 |
2525LL | fn assert_is_send(_: impl Send) {}
2626 | ^^^^ required by this bound in `assert_is_send`
Original file line number Diff line number Diff line change 1+ warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2+ --> $DIR/missing-send-bound.rs:5:12
3+ |
4+ LL | #![feature(async_fn_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: future cannot be sent between threads safely
11+ --> $DIR/missing-send-bound.rs:17:20
12+ |
13+ LL | assert_is_send(test::<T>());
14+ | ^^^^^^^^^^^ future returned by `test` is not `Send`
15+ |
16+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
17+ note: future is not `Send` as it awaits another future which is not `Send`
18+ --> $DIR/missing-send-bound.rs:13:5
19+ |
20+ LL | T::bar().await;
21+ | ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
22+ note: required by a bound in `assert_is_send`
23+ --> $DIR/missing-send-bound.rs:21:27
24+ |
25+ LL | fn assert_is_send(_: impl Send) {}
26+ | ^^^^ required by this bound in `assert_is_send`
27+
28+ error: aborting due to previous error; 1 warning emitted
29+
Original file line number Diff line number Diff line change 11// edition:2021
2+ // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3+ // revisions: current next
24
35#![ feature( async_fn_in_trait) ]
46//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
You can’t perform that action at this time.
0 commit comments