Add revisions to safe/unsafe on unadorned extern blocks test
This commit is contained in:
parent
1afc7d716c
commit
be0726c7c1
@ -1,13 +1,14 @@
|
||||
error: items in unadorned `extern` blocks cannot have safety qualifiers
|
||||
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:2:5
|
||||
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
|
||||
|
|
||||
LL | extern "C" {
|
||||
| ---------- help: add unsafe to this `extern` block
|
||||
LL |
|
||||
LL | safe static TEST1: i32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: items in unadorned `extern` blocks cannot have safety qualifiers
|
||||
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:4:5
|
||||
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:12:5
|
||||
|
|
||||
LL | extern "C" {
|
||||
| ---------- help: add unsafe to this `extern` block
|
@ -0,0 +1,32 @@
|
||||
error: extern blocks must be unsafe
|
||||
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:1
|
||||
|
|
||||
LL | / extern "C" {
|
||||
LL | |
|
||||
LL | | safe static TEST1: i32;
|
||||
LL | |
|
||||
LL | | safe fn test1(i: i32);
|
||||
LL | |
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error: items in unadorned `extern` blocks cannot have safety qualifiers
|
||||
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
|
||||
|
|
||||
LL | extern "C" {
|
||||
| ---------- help: add unsafe to this `extern` block
|
||||
LL |
|
||||
LL | safe static TEST1: i32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: items in unadorned `extern` blocks cannot have safety qualifiers
|
||||
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:12:5
|
||||
|
|
||||
LL | extern "C" {
|
||||
| ---------- help: add unsafe to this `extern` block
|
||||
...
|
||||
LL | safe fn test1(i: i32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -1,4 +1,12 @@
|
||||
//@ revisions: edition2021 edition2024
|
||||
//@[edition2021] edition:2021
|
||||
//@[edition2024] edition:2024
|
||||
//@[edition2024] compile-flags: -Zunstable-options
|
||||
|
||||
#![feature(unsafe_extern_blocks)]
|
||||
|
||||
extern "C" {
|
||||
//[edition2024]~^ ERROR extern blocks must be unsafe
|
||||
safe static TEST1: i32;
|
||||
//~^ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
|
||||
safe fn test1(i: i32);
|
||||
|
Loading…
x
Reference in New Issue
Block a user