embassy/embassy-executor/tests/ui/unsafe_op_in_unsafe_task.rs
Brezak 54d9a7fed3
embassy-executor: add macro ui test for unsafe ops in unsafe tasks
Check if the #[task] macro properly handles unsafe functions so the `unsafe_op_in_unsafe_fn` lint still works
2025-07-23 21:19:30 +02:00

11 lines
216 B
Rust

#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))]
#![deny(unsafe_op_in_unsafe_fn)]
#[embassy_executor::task]
async unsafe fn task() {
let x = 5;
(&x as *const i32).read();
}
fn main() {}