about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2024-06-20 16:19:43 -0300
committerSantiago Pastorino <spastorino@gmail.com>2024-06-21 09:12:13 -0300
commit22831ed1170a3f709588dc562eba6b262f79cf4e (patch)
tree4a615b0dbc1dec5cdc4ccb168d23218991e74d0f /tests/ui/parser
parentd40f30e1df337215f014f6a62053cc315dd26b6b (diff)
Do not allow safe usafe on static and fn items
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/fn-header-semantic-fail.stderr18
-rw-r--r--tests/ui/parser/no-const-fn-in-extern-block.stderr12
2 files changed, 15 insertions, 15 deletions
diff --git a/tests/ui/parser/fn-header-semantic-fail.stderr b/tests/ui/parser/fn-header-semantic-fail.stderr
index abaa6527b0a..29404f1793b 100644
--- a/tests/ui/parser/fn-header-semantic-fail.stderr
+++ b/tests/ui/parser/fn-header-semantic-fail.stderr
@@ -105,15 +105,6 @@ LL |     extern "C" {
 LL |         extern "C" fn fe4();
    |         ^^^^^^^^^^ help: remove this qualifier
 
-error: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:50:9
-   |
-LL |     extern "C" {
-   |     ---------- help: add unsafe to this `extern` block
-...
-LL |         const async unsafe extern "C" fn fe5();
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/fn-header-semantic-fail.rs:50:15
    |
@@ -141,6 +132,15 @@ LL |     extern "C" {
 LL |         const async unsafe extern "C" fn fe5();
    |                            ^^^^^^^^^^ help: remove this qualifier
 
+error: items in unadorned `extern` blocks cannot have safety qualifiers
+  --> $DIR/fn-header-semantic-fail.rs:50:9
+   |
+LL |     extern "C" {
+   |     ---------- help: add unsafe to this `extern` block
+...
+LL |         const async unsafe extern "C" fn fe5();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 error: functions cannot be both `const` and `async`
   --> $DIR/fn-header-semantic-fail.rs:50:9
    |
diff --git a/tests/ui/parser/no-const-fn-in-extern-block.stderr b/tests/ui/parser/no-const-fn-in-extern-block.stderr
index 892024ce893..f575acc839d 100644
--- a/tests/ui/parser/no-const-fn-in-extern-block.stderr
+++ b/tests/ui/parser/no-const-fn-in-extern-block.stderr
@@ -6,23 +6,23 @@ LL | extern "C" {
 LL |     const fn foo();
    |     ^^^^^ help: remove this qualifier
 
-error: items in unadorned `extern` blocks cannot have safety qualifiers
+error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/no-const-fn-in-extern-block.rs:4:5
    |
 LL | extern "C" {
-   | ---------- help: add unsafe to this `extern` block
+   | ---------- in this `extern` block
 ...
 LL |     const unsafe fn bar();
-   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^ help: remove this qualifier
 
-error: functions in `extern` blocks cannot have qualifiers
+error: items in unadorned `extern` blocks cannot have safety qualifiers
   --> $DIR/no-const-fn-in-extern-block.rs:4:5
    |
 LL | extern "C" {
-   | ---------- in this `extern` block
+   | ---------- help: add unsafe to this `extern` block
 ...
 LL |     const unsafe fn bar();
-   |     ^^^^^ help: remove this qualifier
+   |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 3 previous errors