Add unsafe extern blocks failing tests
This commit is contained in:
parent
30ea1a2693
commit
68b0b86c5b
2 changed files with 20 additions and 0 deletions
12
tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs
Normal file
12
tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
extern "C" {
|
||||||
|
static TEST1: i32;
|
||||||
|
fn test1(i: i32);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe extern "C" {
|
||||||
|
//~^ ERROR: extern block cannot be declared unsafe
|
||||||
|
static TEST2: i32;
|
||||||
|
fn test2(i: i32);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -0,0 +1,8 @@
|
||||||
|
error: extern block cannot be declared unsafe
|
||||||
|
--> $DIR/extern-items.rs:6:1
|
||||||
|
|
|
||||||
|
LL | unsafe extern "C" {
|
||||||
|
| ^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue