summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/async-fn-nonsend.no_drop_tracking.stderr
blob: 5cec21d890ef16e8af1aa17c4861f007f4f6fc4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
error: future cannot be sent between threads safely
  --> $DIR/async-fn-nonsend.rs:70:17
   |
LL |     assert_send(local_dropped_before_await());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
  --> $DIR/async-fn-nonsend.rs:27:10
   |
LL |     let x = non_send();
   |         - has type `impl Debug` which is not `Send`
LL |     drop(x);
LL |     fut().await;
   |          ^^^^^^ await occurs here, with `x` maybe used later
LL | }
   | - `x` is later dropped here
note: required by a bound in `assert_send`
  --> $DIR/async-fn-nonsend.rs:67:24
   |
LL | fn assert_send(_: impl Send) {}
   |                        ^^^^ required by this bound in `assert_send`

error: future cannot be sent between threads safely
  --> $DIR/async-fn-nonsend.rs:72:17
   |
LL |     assert_send(non_send_temporary_in_match());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
  --> $DIR/async-fn-nonsend.rs:36:25
   |
LL |     match Some(non_send()) {
   |                ---------- has type `impl Debug` which is not `Send`
LL |         Some(_) => fut().await,
   |                         ^^^^^^ await occurs here, with `non_send()` maybe used later
...
LL | }
   | - `non_send()` is later dropped here
note: required by a bound in `assert_send`
  --> $DIR/async-fn-nonsend.rs:67:24
   |
LL | fn assert_send(_: impl Send) {}
   |                        ^^^^ required by this bound in `assert_send`

error: future cannot be sent between threads safely
  --> $DIR/async-fn-nonsend.rs:74:17
   |
LL |     assert_send(non_sync_with_method_call());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
note: future is not `Send` as this value is used across an await
  --> $DIR/async-fn-nonsend.rs:49:14
   |
LL |     let f: &mut std::fmt::Formatter = &mut get_formatter();
   |                                            --------------- has type `Formatter<'_>` which is not `Send`
...
LL |         fut().await;
   |              ^^^^^^ await occurs here, with `get_formatter()` maybe used later
LL |     }
LL | }
   | - `get_formatter()` is later dropped here
note: required by a bound in `assert_send`
  --> $DIR/async-fn-nonsend.rs:67:24
   |
LL | fn assert_send(_: impl Send) {}
   |                        ^^^^ required by this bound in `assert_send`

error: future cannot be sent between threads safely
  --> $DIR/async-fn-nonsend.rs:76:17
   |
LL |     assert_send(non_sync_with_method_call_panic());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_panic` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
note: future is not `Send` as this value is used across an await
  --> $DIR/async-fn-nonsend.rs:56:14
   |
LL |     let f: &mut std::fmt::Formatter = panic!();
   |         - has type `&mut Formatter<'_>` which is not `Send`
LL |     if non_sync().fmt(f).unwrap() == () {
LL |         fut().await;
   |              ^^^^^^ await occurs here, with `f` maybe used later
LL |     }
LL | }
   | - `f` is later dropped here
note: required by a bound in `assert_send`
  --> $DIR/async-fn-nonsend.rs:67:24
   |
LL | fn assert_send(_: impl Send) {}
   |                        ^^^^ required by this bound in `assert_send`

error: future cannot be sent between threads safely
  --> $DIR/async-fn-nonsend.rs:78:17
   |
LL |     assert_send(non_sync_with_method_call_infinite_loop());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_infinite_loop` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
note: future is not `Send` as this value is used across an await
  --> $DIR/async-fn-nonsend.rs:63:14
   |
LL |     let f: &mut std::fmt::Formatter = loop {};
   |         - has type `&mut Formatter<'_>` which is not `Send`
LL |     if non_sync().fmt(f).unwrap() == () {
LL |         fut().await;
   |              ^^^^^^ await occurs here, with `f` maybe used later
LL |     }
LL | }
   | - `f` is later dropped here
note: required by a bound in `assert_send`
  --> $DIR/async-fn-nonsend.rs:67:24
   |
LL | fn assert_send(_: impl Send) {}
   |                        ^^^^ required by this bound in `assert_send`

error: aborting due to 5 previous errors