Add unsafe extern blocks failing tests

This commit is contained in:
Santiago Pastorino 2024-04-24 18:53:56 -03:00
parent 30ea1a2693
commit 68b0b86c5b
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
2 changed files with 20 additions and 0 deletions

View 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() {}

View File

@ -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