|
| 1 | +error: future cannot be sent between threads safely |
| 2 | + --> $DIR/future_not_send.rs:8:62 |
| 3 | + | |
| 4 | +LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool { |
| 5 | + | ^^^^ future returned by `private_future` is not `Send` |
| 6 | + | |
| 7 | + = note: `-D clippy::future-not-send` implied by `-D warnings` |
| 8 | +note: future is not `Send` as this value is used across an await |
| 9 | + --> $DIR/future_not_send.rs:9:5 |
| 10 | + | |
| 11 | +LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool { |
| 12 | + | -- has type `std::rc::Rc<[u8]>` which is not `Send` |
| 13 | +LL | async { true }.await |
| 14 | + | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `rc` maybe used later |
| 15 | +LL | } |
| 16 | + | - `rc` is later dropped here |
| 17 | + = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send` |
| 18 | +note: future is not `Send` as this value is used across an await |
| 19 | + --> $DIR/future_not_send.rs:9:5 |
| 20 | + | |
| 21 | +LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool { |
| 22 | + | ---- has type `&std::cell::Cell<usize>` which is not `Send` |
| 23 | +LL | async { true }.await |
| 24 | + | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `cell` maybe used later |
| 25 | +LL | } |
| 26 | + | - `cell` is later dropped here |
| 27 | + = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync` |
| 28 | + |
| 29 | +error: future cannot be sent between threads safely |
| 30 | + --> $DIR/future_not_send.rs:12:42 |
| 31 | + | |
| 32 | +LL | pub async fn public_future(rc: Rc<[u8]>) { |
| 33 | + | ^ future returned by `public_future` is not `Send` |
| 34 | + | |
| 35 | +note: future is not `Send` as this value is used across an await |
| 36 | + --> $DIR/future_not_send.rs:13:5 |
| 37 | + | |
| 38 | +LL | pub async fn public_future(rc: Rc<[u8]>) { |
| 39 | + | -- has type `std::rc::Rc<[u8]>` which is not `Send` |
| 40 | +LL | async { true }.await; |
| 41 | + | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `rc` maybe used later |
| 42 | +LL | } |
| 43 | + | - `rc` is later dropped here |
| 44 | + = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send` |
| 45 | + |
| 46 | +error: future cannot be sent between threads safely |
| 47 | + --> $DIR/future_not_send.rs:20:63 |
| 48 | + | |
| 49 | +LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool { |
| 50 | + | ^^^^ |
| 51 | + | |
| 52 | + = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send` |
| 53 | + = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync` |
| 54 | + |
| 55 | +error: future cannot be sent between threads safely |
| 56 | + --> $DIR/future_not_send.rs:24:43 |
| 57 | + | |
| 58 | +LL | pub async fn public_future2(rc: Rc<[u8]>) {} |
| 59 | + | ^ |
| 60 | + | |
| 61 | + = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send` |
| 62 | + |
| 63 | +error: future cannot be sent between threads safely |
| 64 | + --> $DIR/future_not_send.rs:35:39 |
| 65 | + | |
| 66 | +LL | async fn private_future(&self) -> usize { |
| 67 | + | ^^^^^ future returned by `private_future` is not `Send` |
| 68 | + | |
| 69 | +note: future is not `Send` as this value is used across an await |
| 70 | + --> $DIR/future_not_send.rs:36:9 |
| 71 | + | |
| 72 | +LL | async fn private_future(&self) -> usize { |
| 73 | + | ----- has type `&Dummy` which is not `Send` |
| 74 | +LL | async { true }.await; |
| 75 | + | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `&self` maybe used later |
| 76 | +LL | self.rc.len() |
| 77 | +LL | } |
| 78 | + | - `&self` is later dropped here |
| 79 | + = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync` |
| 80 | + |
| 81 | +error: future cannot be sent between threads safely |
| 82 | + --> $DIR/future_not_send.rs:40:39 |
| 83 | + | |
| 84 | +LL | pub async fn public_future(&self) { |
| 85 | + | ^ future returned by `public_future` is not `Send` |
| 86 | + | |
| 87 | +note: future is not `Send` as this value is used across an await |
| 88 | + --> $DIR/future_not_send.rs:41:9 |
| 89 | + | |
| 90 | +LL | pub async fn public_future(&self) { |
| 91 | + | ----- has type `&Dummy` which is not `Send` |
| 92 | +LL | self.private_future().await; |
| 93 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here, with `&self` maybe used later |
| 94 | +LL | } |
| 95 | + | - `&self` is later dropped here |
| 96 | + = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync` |
| 97 | + |
| 98 | +error: future cannot be sent between threads safely |
| 99 | + --> $DIR/future_not_send.rs:49:37 |
| 100 | + | |
| 101 | +LL | async fn generic_future<T>(t: T) -> T |
| 102 | + | ^ future returned by `generic_future` is not `Send` |
| 103 | + | |
| 104 | +note: future is not `Send` as this value is used across an await |
| 105 | + --> $DIR/future_not_send.rs:54:5 |
| 106 | + | |
| 107 | +LL | let rt = &t; |
| 108 | + | -- has type `&T` which is not `Send` |
| 109 | +LL | async { true }.await; |
| 110 | + | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `rt` maybe used later |
| 111 | +LL | t |
| 112 | +LL | } |
| 113 | + | - `rt` is later dropped here |
| 114 | + = note: `T` doesn't implement `std::marker::Sync` |
| 115 | + |
| 116 | +error: future cannot be sent between threads safely |
| 117 | + --> $DIR/future_not_send.rs:65:34 |
| 118 | + | |
| 119 | +LL | async fn unclear_future<T>(t: T) {} |
| 120 | + | ^ |
| 121 | + | |
| 122 | + = note: `T` doesn't implement `std::marker::Send` |
| 123 | + |
| 124 | +error: aborting due to 8 previous errors |
| 125 | + |
0 commit comments