]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/async-await-let-else.drop-tracking.stderr
Rollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum
[rust.git] / tests / ui / async-await / async-await-let-else.drop-tracking.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/async-await-let-else.rs:48:13
3    |
4 LL |     is_send(foo(Some(true)));
5    |             ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
6    |
7    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8 note: future is not `Send` as this value is used across an await
9   --> $DIR/async-await-let-else.rs:11:14
10    |
11 LL |         let r = Rc::new(());
12    |             - has type `Rc<()>` which is not `Send`
13 LL |         bar().await
14    |              ^^^^^^ await occurs here, with `r` maybe used later
15 LL |     };
16    |     - `r` is later dropped here
17 note: required by a bound in `is_send`
18   --> $DIR/async-await-let-else.rs:19:15
19    |
20 LL | fn is_send<T: Send>(_: T) {}
21    |               ^^^^ required by this bound in `is_send`
22
23 error[E0277]: `Rc<()>` cannot be sent between threads safely
24   --> $DIR/async-await-let-else.rs:50:13
25    |
26 LL | async fn foo2(x: Option<bool>) {
27    |                                - within this `impl Future<Output = ()>`
28 ...
29 LL |     is_send(foo2(Some(true)));
30    |     ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
31    |     |
32    |     required by a bound introduced by this call
33    |
34    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
35 note: required because it's used within this `async fn` body
36   --> $DIR/async-await-let-else.rs:27:29
37    |
38 LL |   async fn bar2<T>(_: T) -> ! {
39    |  _____________________________^
40 LL | |     panic!()
41 LL | | }
42    | |_^
43    = note: required because it captures the following types: `ResumeTy`, `Option<bool>`, `impl Future<Output = !>`, `()`
44 note: required because it's used within this `async fn` body
45   --> $DIR/async-await-let-else.rs:21:32
46    |
47 LL |   async fn foo2(x: Option<bool>) {
48    |  ________________________________^
49 LL | |     let Some(_) = x else {
50 LL | |         bar2(Rc::new(())).await
51 LL | |     };
52 LL | | }
53    | |_^
54 note: required by a bound in `is_send`
55   --> $DIR/async-await-let-else.rs:19:15
56    |
57 LL | fn is_send<T: Send>(_: T) {}
58    |               ^^^^ required by this bound in `is_send`
59
60 error: future cannot be sent between threads safely
61   --> $DIR/async-await-let-else.rs:52:13
62    |
63 LL |     is_send(foo3(Some(true)));
64    |             ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
65    |
66    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
67 note: future is not `Send` as this value is used across an await
68   --> $DIR/async-await-let-else.rs:33:28
69    |
70 LL |         (Rc::new(()), bar().await);
71    |          -----------       ^^^^^^ - `Rc::new(())` is later dropped here
72    |          |                 |
73    |          |                 await occurs here, with `Rc::new(())` maybe used later
74    |          has type `Rc<()>` which is not `Send`
75 note: required by a bound in `is_send`
76   --> $DIR/async-await-let-else.rs:19:15
77    |
78 LL | fn is_send<T: Send>(_: T) {}
79    |               ^^^^ required by this bound in `is_send`
80
81 error: future cannot be sent between threads safely
82   --> $DIR/async-await-let-else.rs:54:13
83    |
84 LL |     is_send(foo4(Some(true)));
85    |             ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
86    |
87    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
88 note: future is not `Send` as this value is used across an await
89   --> $DIR/async-await-let-else.rs:41:14
90    |
91 LL |         let r = Rc::new(());
92    |             - has type `Rc<()>` which is not `Send`
93 LL |         bar().await;
94    |              ^^^^^^ await occurs here, with `r` maybe used later
95 ...
96 LL |     };
97    |     - `r` is later dropped here
98 note: required by a bound in `is_send`
99   --> $DIR/async-await-let-else.rs:19:15
100    |
101 LL | fn is_send<T: Send>(_: T) {}
102    |               ^^^^ required by this bound in `is_send`
103
104 error: aborting due to 4 previous errors
105
106 For more information about this error, try `rustc --explain E0277`.