add some new tests
This commit is contained in:
parent
70164739e8
commit
e8a29fbe3c
3 changed files with 23 additions and 1 deletions
11
src/test/compile-fail/native-unsafe-fn-called.rs
Normal file
11
src/test/compile-fail/native-unsafe-fn-called.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// -*- rust -*-
|
||||
// error-pattern: safe function calls function marked unsafe
|
||||
|
||||
native "cdecl" mod test {
|
||||
unsafe fn free();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test::free();
|
||||
}
|
||||
|
12
src/test/compile-fail/native-unsafe-fn.rs
Normal file
12
src/test/compile-fail/native-unsafe-fn.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
// -*- rust -*-
|
||||
// error-pattern: unsafe functions can only be called
|
||||
|
||||
native "cdecl" mod test {
|
||||
unsafe fn free();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = test::free;
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
// -*- rust -*-
|
||||
// error-pattern: safe function calls function marked unsafe
|
||||
// xfail-test
|
||||
|
||||
unsafe fn f() { ret; }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue