rust/tests/ui/generator/issue-45729-unsafe-in-generator.rs
2023-01-11 09:32:08 +00:00

13 lines
230 B
Rust

// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
#![feature(generators)]
fn main() {
let _ = || {
*(1 as *mut u32) = 42;
//~^ ERROR dereference of raw pointer is unsafe
yield;
};
}