Skip to content

Commit f4b3f15

Browse files
committed
Add unsafe extern blocks failing tests
1 parent 622d037 commit f4b3f15

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extern "C" {
2+
static TEST1: i32;
3+
fn test1(i: i32);
4+
}
5+
6+
unsafe extern "C" {
7+
//~^ ERROR: extern block cannot be declared unsafe
8+
static TEST2: i32;
9+
fn test2(i: i32);
10+
}
11+
12+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: extern block cannot be declared unsafe
2+
--> $DIR/extern-items.rs:6:1
3+
|
4+
LL | unsafe extern "C" {
5+
| ^^^^^^
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)