diff options
Diffstat (limited to 'embassy-executor/tests/ui/spawn_nonsend.stderr')
| -rw-r--r-- | embassy-executor/tests/ui/spawn_nonsend.stderr | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/embassy-executor/tests/ui/spawn_nonsend.stderr b/embassy-executor/tests/ui/spawn_nonsend.stderr new file mode 100644 index 000000000..2a06c8b94 --- /dev/null +++ b/embassy-executor/tests/ui/spawn_nonsend.stderr | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | warning: unused import: `core::future::Future` | ||
| 2 | --> tests/ui/spawn_nonsend.rs:3:5 | ||
| 3 | | | ||
| 4 | 3 | use core::future::Future; | ||
| 5 | | ^^^^^^^^^^^^^^^^^^^^ | ||
| 6 | | | ||
| 7 | = note: `#[warn(unused_imports)]` on by default | ||
| 8 | |||
| 9 | error[E0277]: `*mut ()` cannot be sent between threads safely | ||
| 10 | --> tests/ui/spawn_nonsend.rs:13:13 | ||
| 11 | | | ||
| 12 | 7 | #[embassy_executor::task] | ||
| 13 | | ------------------------- within this `impl Sized` | ||
| 14 | ... | ||
| 15 | 13 | s.spawn(task(core::ptr::null_mut())).unwrap(); | ||
| 16 | | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be sent between threads safely | ||
| 17 | | | | ||
| 18 | | required by a bound introduced by this call | ||
| 19 | | | ||
| 20 | = help: within `impl Sized`, the trait `Send` is not implemented for `*mut ()` | ||
| 21 | note: required because it's used within this closure | ||
| 22 | --> tests/ui/spawn_nonsend.rs:7:1 | ||
| 23 | | | ||
| 24 | 7 | #[embassy_executor::task] | ||
| 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 26 | note: required because it appears within the type `impl Sized` | ||
| 27 | --> src/raw/mod.rs | ||
| 28 | | | ||
| 29 | | pub unsafe fn _spawn_async_fn<FutFn>(&'static self, future: FutFn) -> SpawnToken<impl Sized> | ||
| 30 | | ^^^^^^^^^^ | ||
| 31 | note: required because it appears within the type `impl Sized` | ||
| 32 | --> tests/ui/spawn_nonsend.rs:7:1 | ||
| 33 | | | ||
| 34 | 7 | #[embassy_executor::task] | ||
| 35 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 36 | note: required by a bound in `SendSpawner::spawn` | ||
| 37 | --> src/spawner.rs | ||
| 38 | | | ||
| 39 | | pub fn spawn<S: Send>(&self, token: SpawnToken<S>) -> Result<(), SpawnError> { | ||
| 40 | | ^^^^ required by this bound in `SendSpawner::spawn` | ||
| 41 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
