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