about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2024-07-18 11:54:04 -0300
committerSantiago Pastorino <spastorino@gmail.com>2024-07-23 00:29:39 -0300
commit8366c7fe9c2db004224648239644f0fbecc185ea (patch)
tree9cc89985d3da5ed71da7656d91079d2700ac5d8a /tests/ui/parser
parent20f23abbecd7ac5e04dd7ccadc29c3824e28a269 (diff)
downloadrust-8366c7fe9c2db004224648239644f0fbecc185ea.tar.gz
rust-8366c7fe9c2db004224648239644f0fbecc185ea.zip
Stabilize unsafe extern blocks (RFC 3484)
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/unsafe-foreign-mod-2.rs2
-rw-r--r--tests/ui/parser/unsafe-foreign-mod-2.stderr18
-rw-r--r--tests/ui/parser/unsafe-foreign-mod.rs6
-rw-r--r--tests/ui/parser/unsafe-foreign-mod.stderr12
4 files changed, 4 insertions, 34 deletions
diff --git a/tests/ui/parser/unsafe-foreign-mod-2.rs b/tests/ui/parser/unsafe-foreign-mod-2.rs
index 0b63a993c5b..6d339cd9088 100644
--- a/tests/ui/parser/unsafe-foreign-mod-2.rs
+++ b/tests/ui/parser/unsafe-foreign-mod-2.rs
@@ -1,8 +1,6 @@
 extern "C" unsafe {
     //~^ ERROR expected `{`, found keyword `unsafe`
-    //~| ERROR extern block cannot be declared unsafe
     unsafe fn foo();
-    //~^ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
 }
 
 fn main() {}
diff --git a/tests/ui/parser/unsafe-foreign-mod-2.stderr b/tests/ui/parser/unsafe-foreign-mod-2.stderr
index 8bd592b5d43..0625e3362ed 100644
--- a/tests/ui/parser/unsafe-foreign-mod-2.stderr
+++ b/tests/ui/parser/unsafe-foreign-mod-2.stderr
@@ -4,21 +4,5 @@ error: expected `{`, found keyword `unsafe`
 LL | extern "C" unsafe {
    |            ^^^^^^ expected `{`
 
-error: extern block cannot be declared unsafe
-  --> $DIR/unsafe-foreign-mod-2.rs:1:12
-   |
-LL | extern "C" unsafe {
-   |            ^^^^^^
-   |
-   = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
-   = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/unsafe-foreign-mod-2.rs:4:5
-   |
-LL |     unsafe fn foo();
-   |     ^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 1 previous error
 
diff --git a/tests/ui/parser/unsafe-foreign-mod.rs b/tests/ui/parser/unsafe-foreign-mod.rs
index eab134a4a4d..623c3bb81e4 100644
--- a/tests/ui/parser/unsafe-foreign-mod.rs
+++ b/tests/ui/parser/unsafe-foreign-mod.rs
@@ -1,5 +1,5 @@
-unsafe extern "C" {
-    //~^ ERROR extern block cannot be declared unsafe
-}
+//@ check-pass
+
+unsafe extern "C" {}
 
 fn main() {}
diff --git a/tests/ui/parser/unsafe-foreign-mod.stderr b/tests/ui/parser/unsafe-foreign-mod.stderr
deleted file mode 100644
index 60b918a89b3..00000000000
--- a/tests/ui/parser/unsafe-foreign-mod.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error: extern block cannot be declared unsafe
-  --> $DIR/unsafe-foreign-mod.rs:1:1
-   |
-LL | unsafe extern "C" {
-   | ^^^^^^
-   |
-   = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
-   = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error: aborting due to 1 previous error
-