|
1 |
| -error[E0277]: `Sender<i32>` cannot be shared between threads safely |
2 |
| - --> $DIR/issue-70935-complex-spans.rs:13:45 |
| 1 | +error[E0277]: `*mut ()` cannot be shared between threads safely |
| 2 | + --> $DIR/issue-70935-complex-spans.rs:18:23 |
3 | 3 | |
|
4 |
| -LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send { |
5 |
| - | ^^^^^^^^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely |
| 4 | +LL | fn foo(x: NotSync) -> impl Future + Send { |
| 5 | + | ^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely |
6 | 6 | |
|
7 |
| - = help: the trait `Sync` is not implemented for `Sender<i32>` |
8 |
| - = note: required for `&Sender<i32>` to implement `Send` |
| 7 | + = help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()` |
| 8 | +note: required because it appears within the type `PhantomData<*mut ()>` |
| 9 | + --> $SRC_DIR/core/src/marker.rs:LL:COL |
| 10 | +note: required because it appears within the type `NotSync` |
| 11 | + --> $DIR/issue-70935-complex-spans.rs:12:8 |
| 12 | + | |
| 13 | +LL | struct NotSync(PhantomData<*mut ()>); |
| 14 | + | ^^^^^^^ |
| 15 | + = note: required for `&NotSync` to implement `Send` |
9 | 16 | note: required because it's used within this closure
|
10 |
| - --> $DIR/issue-70935-complex-spans.rs:17:13 |
| 17 | + --> $DIR/issue-70935-complex-spans.rs:22:13 |
11 | 18 | |
|
12 |
| -LL | baz(|| async{ |
| 19 | +LL | baz(|| async { |
13 | 20 | | ^^
|
14 | 21 | note: required because it's used within this `async fn` body
|
15 |
| - --> $DIR/issue-70935-complex-spans.rs:10:67 |
| 22 | + --> $DIR/issue-70935-complex-spans.rs:15:67 |
16 | 23 | |
|
17 | 24 | LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
|
18 | 25 | | ___________________________________________________________________^
|
19 | 26 | LL | | }
|
20 | 27 | | |_^
|
21 | 28 | = note: required because it captures the following types: `ResumeTy`, `impl Future<Output = ()>`, `()`
|
22 | 29 | note: required because it's used within this `async` block
|
23 |
| - --> $DIR/issue-70935-complex-spans.rs:16:5 |
| 30 | + --> $DIR/issue-70935-complex-spans.rs:21:5 |
24 | 31 | |
|
25 | 32 | LL | / async move {
|
26 |
| -LL | | baz(|| async{ |
27 |
| -LL | | foo(tx.clone()); |
| 33 | +LL | | baz(|| async { |
| 34 | +LL | | foo(x.clone()); |
28 | 35 | LL | | }).await;
|
29 | 36 | LL | | }
|
30 | 37 | | |_____^
|
|
0 commit comments