@@ -12,30 +12,43 @@ LL | let r = Rc::new(());
1212 | - has type `Rc<()>` which is not `Send`
1313LL | bar().await
1414 | ^^^^^ await occurs here, with `r` maybe used later
15- LL | };
16- | - `r` is later dropped here
1715note: required by a bound in `is_send`
1816 --> $DIR/async-await-let-else.rs:16:15
1917 |
2018LL | fn is_send<T: Send>(_: T) {}
2119 | ^^^^ required by this bound in `is_send`
2220
23- error: future cannot be sent between threads safely
21+ error[E0277]: `Rc<()>` cannot be sent between threads safely
2422 --> $DIR/async-await-let-else.rs:47:13
2523 |
24+ LL | async fn foo2(x: Option<bool>) {
25+ | - within this `impl Future<Output = ()>`
26+ ...
2627LL | is_send(foo2(Some(true)));
27- | ^^^^^^^^^^^^^^^^ future returned by `foo2` is not `Send`
28+ | ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
29+ | |
30+ | required by a bound introduced by this call
2831 |
2932 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
30- note: future is not `Send` as this value is used across an await
31- --> $DIR/async-await-let-else.rs:20:27
32- |
33- LL | bar2(Rc::new(())).await
34- | ----------- ^^^^^ await occurs here, with `Rc::new(())` maybe used later
35- | |
36- | has type `Rc<()>` which is not `Send`
37- LL | };
38- | - `Rc::new(())` is later dropped here
33+ note: required because it's used within this `async fn` body
34+ --> $DIR/async-await-let-else.rs:24:29
35+ |
36+ LL | async fn bar2<T>(_: T) -> ! {
37+ | _____________________________^
38+ LL | | panic!()
39+ LL | | }
40+ | |_^
41+ = note: required because it captures the following types: `impl Future<Output = !>`
42+ note: required because it's used within this `async fn` body
43+ --> $DIR/async-await-let-else.rs:18:32
44+ |
45+ LL | async fn foo2(x: Option<bool>) {
46+ | ________________________________^
47+ LL | | let Some(_) = x else {
48+ LL | | bar2(Rc::new(())).await
49+ LL | | };
50+ LL | | }
51+ | |_^
3952note: required by a bound in `is_send`
4053 --> $DIR/async-await-let-else.rs:16:15
4154 |
@@ -53,9 +66,8 @@ note: future is not `Send` as this value is used across an await
5366 --> $DIR/async-await-let-else.rs:30:29
5467 |
5568LL | (Rc::new(()), bar().await);
56- | ----------- ^^^^^ - `Rc::new(())` is later dropped here
57- | | |
58- | | await occurs here, with `Rc::new(())` maybe used later
69+ | ----------- ^^^^^ await occurs here, with `Rc::new(())` maybe used later
70+ | |
5971 | has type `Rc<()>` which is not `Send`
6072note: required by a bound in `is_send`
6173 --> $DIR/async-await-let-else.rs:16:15
@@ -77,9 +89,6 @@ LL | let r = Rc::new(());
7789 | - has type `Rc<()>` which is not `Send`
7890LL | bar().await;
7991 | ^^^^^ await occurs here, with `r` maybe used later
80- ...
81- LL | };
82- | - `r` is later dropped here
8392note: required by a bound in `is_send`
8493 --> $DIR/async-await-let-else.rs:16:15
8594 |
@@ -88,3 +97,4 @@ LL | fn is_send<T: Send>(_: T) {}
8897
8998error: aborting due to 4 previous errors
9099
100+ For more information about this error, try `rustc --explain E0277`.
0 commit comments