new test
This commit is contained in:
parent
215b1ab000
commit
5b015288b5
1 changed files with 11 additions and 0 deletions
11
src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs
Normal file
11
src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// -*- rust -*-
|
||||
// error-pattern: unsafe operation requires unsafe function or block
|
||||
|
||||
fn f(p: *u8) {
|
||||
*p = 0u8;
|
||||
ret;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
f();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue