File tree 4 files changed +36
-4
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting
tests/ui/async-await/in-trait
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>(
420
420
) {
421
421
if hir_generics. where_clause_span . from_expansion ( )
422
422
|| hir_generics. where_clause_span . desugaring_kind ( ) . is_some ( )
423
+ || projection. map_or ( false , |projection| tcx. opt_rpitit_info ( projection. def_id ) . is_some ( ) )
423
424
{
424
425
return ;
425
426
}
Original file line number Diff line number Diff line change 1
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:3 :12
2
+ --> $DIR/missing-send-bound.rs:5 :12
3
3
|
4
4
LL | #![feature(async_fn_in_trait)]
5
5
| ^^^^^^^^^^^^^^^^^
@@ -8,19 +8,19 @@ LL | #![feature(async_fn_in_trait)]
8
8
= note: `#[warn(incomplete_features)]` on by default
9
9
10
10
error: future cannot be sent between threads safely
11
- --> $DIR/missing-send-bound.rs:15 :20
11
+ --> $DIR/missing-send-bound.rs:17 :20
12
12
|
13
13
LL | assert_is_send(test::<T>());
14
14
| ^^^^^^^^^^^ future returned by `test` is not `Send`
15
15
|
16
16
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
17
17
note: 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
19
19
|
20
20
LL | T::bar().await;
21
21
| ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
22
22
note: required by a bound in `assert_is_send`
23
- --> $DIR/missing-send-bound.rs:19 :27
23
+ --> $DIR/missing-send-bound.rs:21 :27
24
24
|
25
25
LL | fn assert_is_send(_: impl Send) {}
26
26
| ^^^^ 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 1
1
// edition:2021
2
+ // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3
+ // revisions: current next
2
4
3
5
#![ feature( async_fn_in_trait) ]
4
6
//~^ 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