aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/tests
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-executor/tests')
-rw-r--r--embassy-executor/tests/test.rs6
-rw-r--r--embassy-executor/tests/ui/nonstatic_struct_elided.stderr12
-rw-r--r--embassy-executor/tests/ui/task_safety_attribute.rs2
3 files changed, 10 insertions, 10 deletions
diff --git a/embassy-executor/tests/test.rs b/embassy-executor/tests/test.rs
index 6baf3dc21..a99976168 100644
--- a/embassy-executor/tests/test.rs
+++ b/embassy-executor/tests/test.rs
@@ -2,14 +2,14 @@
2#![cfg_attr(feature = "nightly", feature(never_type))] 2#![cfg_attr(feature = "nightly", feature(never_type))]
3 3
4use std::boxed::Box; 4use std::boxed::Box;
5use std::future::{poll_fn, Future}; 5use std::future::{Future, poll_fn};
6use std::sync::{Arc, Mutex}; 6use std::sync::{Arc, Mutex};
7use std::task::Poll; 7use std::task::Poll;
8 8
9use embassy_executor::raw::Executor; 9use embassy_executor::raw::Executor;
10use embassy_executor::{task, Spawner}; 10use embassy_executor::{Spawner, task};
11 11
12#[export_name = "__pender"] 12#[unsafe(export_name = "__pender")]
13fn __pender(context: *mut ()) { 13fn __pender(context: *mut ()) {
14 unsafe { 14 unsafe {
15 let trace = &*(context as *const Trace); 15 let trace = &*(context as *const Trace);
diff --git a/embassy-executor/tests/ui/nonstatic_struct_elided.stderr b/embassy-executor/tests/ui/nonstatic_struct_elided.stderr
index 0ee1bfe0c..e6829bf5d 100644
--- a/embassy-executor/tests/ui/nonstatic_struct_elided.stderr
+++ b/embassy-executor/tests/ui/nonstatic_struct_elided.stderr
@@ -9,16 +9,16 @@ help: indicate the anonymous lifetime
96 | async fn task(_x: Foo<'_>) {} 96 | async fn task(_x: Foo<'_>) {}
10 | ++++ 10 | ++++
11 11
12error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds 12error: lifetime may not live long enough
13 --> tests/ui/nonstatic_struct_elided.rs:5:1 13 --> tests/ui/nonstatic_struct_elided.rs:5:1
14 | 14 |
155 | #[embassy_executor::task] 155 | #[embassy_executor::task]
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^ opaque type defined here 16 | ^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
176 | async fn task(_x: Foo) {} 176 | async fn task(_x: Foo) {}
18 | --- hidden type `impl Sized` captures the anonymous lifetime defined here 18 | -- has type `Foo<'1>`
19 | 19 |
20 = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) 20 = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
21help: add a `use<...>` bound to explicitly capture `'_` 21help: to declare that `impl Sized` captures data from argument `_x`, you can add an explicit `'_` lifetime bound
22 | 22 |
235 | #[embassy_executor::task] + use<'_> 235 | #[embassy_executor::task] + '_
24 | +++++++++ 24 | ++++
diff --git a/embassy-executor/tests/ui/task_safety_attribute.rs b/embassy-executor/tests/ui/task_safety_attribute.rs
index ab5a2f99f..46a5c665f 100644
--- a/embassy-executor/tests/ui/task_safety_attribute.rs
+++ b/embassy-executor/tests/ui/task_safety_attribute.rs
@@ -9,7 +9,7 @@ async fn safe() {}
9#[embassy_executor::task] 9#[embassy_executor::task]
10async unsafe fn not_safe() {} 10async unsafe fn not_safe() {}
11 11
12#[export_name = "__pender"] 12#[unsafe(export_name = "__pender")]
13fn pender(_: *mut ()) { 13fn pender(_: *mut ()) {
14 // The test doesn't link if we don't include this. 14 // The test doesn't link if we don't include this.
15 // We never call this anyway. 15 // We never call this anyway.