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

12 lines
150 B
Rust
Raw Normal View History

2011-10-11 23:22:08 -05:00
// -*- rust -*-
// error-pattern: unsafe operation requires unsafe function or block
fn f(p: *u8) {
*p = 0u8;
ret;
}
fn main() {
f();
}