From dbff432e19b326d7cef109bc4d2a0cd51260562d Mon Sep 17 00:00:00 2001 From: Matthew Tran <0e4ef622@gmail.com> Date: Thu, 29 May 2025 05:18:16 -0500 Subject: Add test for -> impl Future --- embassy-executor/tests/test.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'embassy-executor') 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 @@ #![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] +#![cfg_attr(feature = "nightly", feature(never_type))] use std::boxed::Box; use std::future::{poll_fn, Future}; @@ -58,6 +59,11 @@ fn executor_task() { trace.push("poll task1") } + #[task] + async fn task2() -> ! { + panic!() + } + let (executor, trace) = setup(); executor.spawner().spawn(task1(trace.clone())).unwrap(); @@ -80,6 +86,12 @@ fn executor_task_rpit() { async move { trace.push("poll task1") } } + #[cfg(feature = "nightly")] + #[task] + fn task2() -> impl Future { + async { panic!() } + } + let (executor, trace) = setup(); executor.spawner().spawn(task1(trace.clone())).unwrap(); -- cgit