diff options
| author | Matthew Tran <[email protected]> | 2025-03-29 02:45:38 -0500 |
|---|---|---|
| committer | Matthew Tran <[email protected]> | 2025-03-29 02:46:32 -0500 |
| commit | c72e2c5d100fd42acdd3a39f6250c112c2a37495 (patch) | |
| tree | 68b18844ba85998c88614f38c49a6d93a0801054 | |
| parent | 954d1554d4c04a245adadb5ebd97205d1442635e (diff) | |
Add test
| -rw-r--r-- | embassy-executor/tests/ui.rs | 1 | ||||
| -rw-r--r-- | embassy-executor/tests/ui/type_error.rs | 8 | ||||
| -rw-r--r-- | embassy-executor/tests/ui/type_error.stderr | 7 |
3 files changed, 16 insertions, 0 deletions
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() { | |||
| 19 | t.compile_fail("tests/ui/not_async.rs"); | 19 | t.compile_fail("tests/ui/not_async.rs"); |
| 20 | t.compile_fail("tests/ui/self_ref.rs"); | 20 | t.compile_fail("tests/ui/self_ref.rs"); |
| 21 | t.compile_fail("tests/ui/self.rs"); | 21 | t.compile_fail("tests/ui/self.rs"); |
| 22 | t.compile_fail("tests/ui/type_error.rs"); | ||
| 22 | t.compile_fail("tests/ui/where_clause.rs"); | 23 | t.compile_fail("tests/ui/where_clause.rs"); |
| 23 | } | 24 | } |
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 @@ | |||
| 1 | #![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] | ||
| 2 | |||
| 3 | #[embassy_executor::task] | ||
| 4 | async fn task() { | ||
| 5 | 5 | ||
| 6 | } | ||
| 7 | |||
| 8 | 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 @@ | |||
| 1 | error[E0308]: mismatched types | ||
| 2 | --> tests/ui/type_error.rs:5:5 | ||
| 3 | | | ||
| 4 | 4 | async fn task() { | ||
| 5 | | - help: try adding a return type: `-> i32` | ||
| 6 | 5 | 5 | ||
| 7 | | ^ expected `()`, found integer | ||
