diff options
| author | Matthew Tran <[email protected]> | 2025-05-29 05:18:16 -0500 |
|---|---|---|
| committer | Matthew Tran <[email protected]> | 2025-05-29 05:18:16 -0500 |
| commit | dbff432e19b326d7cef109bc4d2a0cd51260562d (patch) | |
| tree | b0379b10447e0ac1be205b2ccb931e7a400069b5 /embassy-executor/tests | |
| parent | a4d4f62a1e0e808ec3dd93e282f517a2f8ad9fa5 (diff) | |
Add test for -> impl Future<Output = !>
Diffstat (limited to 'embassy-executor/tests')
| -rw-r--r-- | embassy-executor/tests/test.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/embassy-executor/tests/test.rs b/embassy-executor/tests/test.rs index c7ff4554c..c1e7ec5d7 100644 --- a/embassy-executor/tests/test.rs +++ b/embassy-executor/tests/test.rs | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] | 1 | #![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] |
| 2 | #![cfg_attr(feature = "nightly", feature(never_type))] | ||
| 2 | 3 | ||
| 3 | use std::boxed::Box; | 4 | use std::boxed::Box; |
| 4 | use std::future::{poll_fn, Future}; | 5 | use std::future::{poll_fn, Future}; |
| @@ -58,6 +59,11 @@ fn executor_task() { | |||
| 58 | trace.push("poll task1") | 59 | trace.push("poll task1") |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 62 | #[task] | ||
| 63 | async fn task2() -> ! { | ||
| 64 | panic!() | ||
| 65 | } | ||
| 66 | |||
| 61 | let (executor, trace) = setup(); | 67 | let (executor, trace) = setup(); |
| 62 | executor.spawner().spawn(task1(trace.clone())).unwrap(); | 68 | executor.spawner().spawn(task1(trace.clone())).unwrap(); |
| 63 | 69 | ||
| @@ -80,6 +86,12 @@ fn executor_task_rpit() { | |||
| 80 | async move { trace.push("poll task1") } | 86 | async move { trace.push("poll task1") } |
| 81 | } | 87 | } |
| 82 | 88 | ||
| 89 | #[cfg(feature = "nightly")] | ||
| 90 | #[task] | ||
| 91 | fn task2() -> impl Future<Output = !> { | ||
| 92 | async { panic!() } | ||
| 93 | } | ||
| 94 | |||
| 83 | let (executor, trace) = setup(); | 95 | let (executor, trace) = setup(); |
| 84 | executor.spawner().spawn(task1(trace.clone())).unwrap(); | 96 | executor.spawner().spawn(task1(trace.clone())).unwrap(); |
| 85 | 97 | ||
