diff --git a/embassy-executor/tests/ui.rs b/embassy-executor/tests/ui.rs index be4679485..278a4b903 100644 --- a/embassy-executor/tests/ui.rs +++ b/embassy-executor/tests/ui.rs @@ -19,5 +19,6 @@ fn ui() { t.compile_fail("tests/ui/not_async.rs"); t.compile_fail("tests/ui/self_ref.rs"); t.compile_fail("tests/ui/self.rs"); + t.compile_fail("tests/ui/type_error.rs"); t.compile_fail("tests/ui/where_clause.rs"); } diff --git a/embassy-executor/tests/ui/type_error.rs b/embassy-executor/tests/ui/type_error.rs new file mode 100644 index 000000000..1734bc6c4 --- /dev/null +++ b/embassy-executor/tests/ui/type_error.rs @@ -0,0 +1,8 @@ +#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] + +#[embassy_executor::task] +async fn task() { + 5 +} + +fn main() {} diff --git a/embassy-executor/tests/ui/type_error.stderr b/embassy-executor/tests/ui/type_error.stderr new file mode 100644 index 000000000..bce315811 --- /dev/null +++ b/embassy-executor/tests/ui/type_error.stderr @@ -0,0 +1,7 @@ +error[E0308]: mismatched types + --> tests/ui/type_error.rs:5:5 + | +4 | async fn task() { + | - help: try adding a return type: `-> i32` +5 | 5 + | ^ expected `()`, found integer