diff options
Diffstat (limited to 'embassy-sync/tests/ui.rs')
| -rw-r--r-- | embassy-sync/tests/ui.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/embassy-sync/tests/ui.rs b/embassy-sync/tests/ui.rs new file mode 100644 index 000000000..9ef0d4c67 --- /dev/null +++ b/embassy-sync/tests/ui.rs | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | // #[cfg(not(miri))] | ||
| 2 | #[test] | ||
| 3 | fn ui() { | ||
| 4 | let t = trybuild::TestCases::new(); | ||
| 5 | |||
| 6 | // These test cases should fail to compile since OnceLock and LazyLock should not unconditionally implement sync | ||
| 7 | // for all types. These tests are regression tests against the following issues: | ||
| 8 | // * https://github.com/embassy-rs/embassy/issues/4307 | ||
| 9 | // * https://github.com/embassy-rs/embassy/issues/3904 | ||
| 10 | t.compile_fail("tests/ui/sync_impl/lazy_lock_function.rs"); | ||
| 11 | t.compile_fail("tests/ui/sync_impl/lazy_lock_type.rs"); | ||
| 12 | t.compile_fail("tests/ui/sync_impl/once_lock.rs"); | ||
| 13 | } | ||
