rust/src/test/compile-fail/unsafe-fn-deref-ptr.rs

12 lines
150 B
Rust
Raw Normal View History

// -*- rust -*-
// error-pattern: unsafe operation requires unsafe function or block
fn f(p: *u8) {
*p = 0u8;
ret;
}
fn main() {
f();
}