summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2020-09-01 17:12:52 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2021-01-13 07:49:16 -0500
commit8a3edb1d661ed5ce685bd5dcfa600b6e02897b86 (patch)
tree5615826fc30a674b49dcc89fc09ff84a1fced008 /src/test/ui/parser
parentc4a8d7f86a5d54a2f3b3875e703d06acd12ae7cc (diff)
downloadrust-8a3edb1d661ed5ce685bd5dcfa600b6e02897b86.tar.gz
rust-8a3edb1d661ed5ce685bd5dcfa600b6e02897b86.zip
Update tests for extern block linting
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/attrs-after-extern-mod.rs2
-rw-r--r--src/test/ui/parser/attrs-after-extern-mod.stderr4
-rw-r--r--src/test/ui/parser/bad-lit-suffixes.stderr13
-rw-r--r--src/test/ui/parser/doc-before-extern-rbrace.rs2
-rw-r--r--src/test/ui/parser/duplicate-visibility.rs2
-rw-r--r--src/test/ui/parser/duplicate-visibility.stderr4
-rw-r--r--src/test/ui/parser/extern-no-fn.rs2
-rw-r--r--src/test/ui/parser/extern-no-fn.stderr4
-rw-r--r--src/test/ui/parser/fn-body-eq-expr-semi.rs2
-rw-r--r--src/test/ui/parser/fn-body-eq-expr-semi.stderr8
-rw-r--r--src/test/ui/parser/fn-body-optional-semantic-fail.rs2
-rw-r--r--src/test/ui/parser/fn-body-optional-semantic-fail.stderr4
-rw-r--r--src/test/ui/parser/fn-body-optional-syntactic-pass.rs4
-rw-r--r--src/test/ui/parser/fn-header-semantic-fail.rs2
-rw-r--r--src/test/ui/parser/fn-header-semantic-fail.stderr20
-rw-r--r--src/test/ui/parser/fn-header-syntactic-pass.rs12
-rw-r--r--src/test/ui/parser/foreign-const-semantic-fail.rs2
-rw-r--r--src/test/ui/parser/foreign-const-semantic-fail.stderr4
-rw-r--r--src/test/ui/parser/foreign-const-syntactic-fail.rs2
-rw-r--r--src/test/ui/parser/foreign-static-semantic-fail.rs2
-rw-r--r--src/test/ui/parser/foreign-static-semantic-fail.stderr8
-rw-r--r--src/test/ui/parser/foreign-static-syntactic-pass.rs6
-rw-r--r--src/test/ui/parser/no-const-fn-in-extern-block.rs2
-rw-r--r--src/test/ui/parser/no-const-fn-in-extern-block.stderr8
-rw-r--r--src/test/ui/parser/self-param-semantic-fail.rs6
-rw-r--r--src/test/ui/parser/self-param-syntactic-pass.rs2
-rw-r--r--src/test/ui/parser/unsafe-foreign-mod.rs4
-rw-r--r--src/test/ui/parser/unsafe-foreign-mod.stderr8
-rw-r--r--src/test/ui/parser/variadic-ffi-semantic-restrictions.rs10
-rw-r--r--src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr30
30 files changed, 91 insertions, 90 deletions
diff --git a/src/test/ui/parser/attrs-after-extern-mod.rs b/src/test/ui/parser/attrs-after-extern-mod.rs
index ea899dca7b2..e3f0fa0fc46 100644
--- a/src/test/ui/parser/attrs-after-extern-mod.rs
+++ b/src/test/ui/parser/attrs-after-extern-mod.rs
@@ -2,6 +2,6 @@
 
 fn main() {}
 
-extern {
+extern "C" {
     #[cfg(stage37)] //~ ERROR expected item after attributes
 }
diff --git a/src/test/ui/parser/attrs-after-extern-mod.stderr b/src/test/ui/parser/attrs-after-extern-mod.stderr
index 3862f5c379f..135d98457e1 100644
--- a/src/test/ui/parser/attrs-after-extern-mod.stderr
+++ b/src/test/ui/parser/attrs-after-extern-mod.stderr
@@ -1,8 +1,8 @@
 error: expected item after attributes
   --> $DIR/attrs-after-extern-mod.rs:6:5
    |
-LL | extern {
-   |        - while parsing this item list starting here
+LL | extern "C" {
+   |            - while parsing this item list starting here
 LL |     #[cfg(stage37)]
    |     ^^^^^^^^^^^^^^^
 LL | }
diff --git a/src/test/ui/parser/bad-lit-suffixes.stderr b/src/test/ui/parser/bad-lit-suffixes.stderr
index 9b596571481..8c433961408 100644
--- a/src/test/ui/parser/bad-lit-suffixes.stderr
+++ b/src/test/ui/parser/bad-lit-suffixes.stderr
@@ -110,5 +110,16 @@ LL |     1.0e10suffix;
    |
    = help: valid suffixes are `f32` and `f64`
 
-error: aborting due to 16 previous errors
+error: extern declarations without an explicit ABI are deprecated
+  --> $DIR/bad-lit-suffixes.rs:5:1
+   |
+LL | / extern
+LL | |     "C"suffix
+LL | | {}
+   | |__^ ABI should be specified here
+   |
+   = note: `#[deny(missing_abi)]` on by default
+   = help: the default ABI is C
+
+error: aborting due to 17 previous errors
 
diff --git a/src/test/ui/parser/doc-before-extern-rbrace.rs b/src/test/ui/parser/doc-before-extern-rbrace.rs
index 040206b80ff..515c90ed48c 100644
--- a/src/test/ui/parser/doc-before-extern-rbrace.rs
+++ b/src/test/ui/parser/doc-before-extern-rbrace.rs
@@ -1,6 +1,6 @@
 fn main() {}
 
-extern {
+extern "C" {
     /// hi
     //~^ ERROR found a documentation comment that doesn't document anything
 }
diff --git a/src/test/ui/parser/duplicate-visibility.rs b/src/test/ui/parser/duplicate-visibility.rs
index 31318ae3a09..547329cfb1b 100644
--- a/src/test/ui/parser/duplicate-visibility.rs
+++ b/src/test/ui/parser/duplicate-visibility.rs
@@ -1,6 +1,6 @@
 fn main() {}
 
-extern {
+extern "C" {
     pub pub fn foo();
     //~^ ERROR visibility `pub` is not followed by an item
     //~| ERROR non-item in item list
diff --git a/src/test/ui/parser/duplicate-visibility.stderr b/src/test/ui/parser/duplicate-visibility.stderr
index 36b9efd9dca..8d8122292ae 100644
--- a/src/test/ui/parser/duplicate-visibility.stderr
+++ b/src/test/ui/parser/duplicate-visibility.stderr
@@ -9,8 +9,8 @@ LL |     pub pub fn foo();
 error: non-item in item list
   --> $DIR/duplicate-visibility.rs:4:9
    |
-LL | extern {
-   |        - item list starts here
+LL | extern "C" {
+   |            - item list starts here
 LL |     pub pub fn foo();
    |         ^^^ non-item starts here
 ...
diff --git a/src/test/ui/parser/extern-no-fn.rs b/src/test/ui/parser/extern-no-fn.rs
index d9f35e0eb5c..73568609cdf 100644
--- a/src/test/ui/parser/extern-no-fn.rs
+++ b/src/test/ui/parser/extern-no-fn.rs
@@ -1,4 +1,4 @@
-extern {
+extern "C" {
     f(); //~ ERROR expected one of `!` or `::`, found `(`
 }
 
diff --git a/src/test/ui/parser/extern-no-fn.stderr b/src/test/ui/parser/extern-no-fn.stderr
index 0151cb4235b..d9183d56463 100644
--- a/src/test/ui/parser/extern-no-fn.stderr
+++ b/src/test/ui/parser/extern-no-fn.stderr
@@ -1,8 +1,8 @@
 error: expected one of `!` or `::`, found `(`
   --> $DIR/extern-no-fn.rs:2:6
    |
-LL | extern {
-   |        - while parsing this item list starting here
+LL | extern "C" {
+   |            - while parsing this item list starting here
 LL |     f();
    |      ^ expected one of `!` or `::`
 LL | }
diff --git a/src/test/ui/parser/fn-body-eq-expr-semi.rs b/src/test/ui/parser/fn-body-eq-expr-semi.rs
index 09444079365..7127ba8da61 100644
--- a/src/test/ui/parser/fn-body-eq-expr-semi.rs
+++ b/src/test/ui/parser/fn-body-eq-expr-semi.rs
@@ -5,7 +5,7 @@ fn syntax() {
     fn bar() -> u8 = 42; //~ ERROR function body cannot be `= expression;`
 }
 
-extern {
+extern "C" {
     fn foo() = 42; //~ ERROR function body cannot be `= expression;`
     //~^ ERROR incorrect function inside `extern` block
     fn bar() -> u8 = 42; //~ ERROR function body cannot be `= expression;`
diff --git a/src/test/ui/parser/fn-body-eq-expr-semi.stderr b/src/test/ui/parser/fn-body-eq-expr-semi.stderr
index 739133e0b40..fdc7a9409d7 100644
--- a/src/test/ui/parser/fn-body-eq-expr-semi.stderr
+++ b/src/test/ui/parser/fn-body-eq-expr-semi.stderr
@@ -89,8 +89,8 @@ LL |     fn bar() -> u8 { 42 }
 error: incorrect function inside `extern` block
   --> $DIR/fn-body-eq-expr-semi.rs:9:8
    |
-LL | extern {
-   | ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body
+LL | extern "C" {
+   | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
 LL |     fn foo() = 42;
    |        ^^^   ----- help: remove the invalid body: `;`
    |        |
@@ -102,8 +102,8 @@ LL |     fn foo() = 42;
 error: incorrect function inside `extern` block
   --> $DIR/fn-body-eq-expr-semi.rs:11:8
    |
-LL | extern {
-   | ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body
+LL | extern "C" {
+   | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
 ...
 LL |     fn bar() -> u8 = 42;
    |        ^^^         ----- help: remove the invalid body: `;`
diff --git a/src/test/ui/parser/fn-body-optional-semantic-fail.rs b/src/test/ui/parser/fn-body-optional-semantic-fail.rs
index 38def05e8f2..12df488802e 100644
--- a/src/test/ui/parser/fn-body-optional-semantic-fail.rs
+++ b/src/test/ui/parser/fn-body-optional-semantic-fail.rs
@@ -20,7 +20,7 @@ fn main() {
         fn f4() {} // OK.
     }
 
-    extern {
+    extern "C" {
         fn f5(); // OK.
         fn f6() {} //~ ERROR incorrect function inside `extern` block
     }
diff --git a/src/test/ui/parser/fn-body-optional-semantic-fail.stderr b/src/test/ui/parser/fn-body-optional-semantic-fail.stderr
index 23ce98fb5d7..14bcd7c16fa 100644
--- a/src/test/ui/parser/fn-body-optional-semantic-fail.stderr
+++ b/src/test/ui/parser/fn-body-optional-semantic-fail.stderr
@@ -25,8 +25,8 @@ LL |         fn f3();
 error: incorrect function inside `extern` block
   --> $DIR/fn-body-optional-semantic-fail.rs:25:12
    |
-LL |     extern {
-   |     ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body
+LL |     extern "C" {
+   |     ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
 LL |         fn f5(); // OK.
 LL |         fn f6() {}
    |            ^^   -- help: remove the invalid body: `;`
diff --git a/src/test/ui/parser/fn-body-optional-syntactic-pass.rs b/src/test/ui/parser/fn-body-optional-syntactic-pass.rs
index e7991c73b4b..f9dbebf0bea 100644
--- a/src/test/ui/parser/fn-body-optional-syntactic-pass.rs
+++ b/src/test/ui/parser/fn-body-optional-syntactic-pass.rs
@@ -24,8 +24,8 @@ fn syntax() {
         fn f() {}
     }
 
-    extern {
+    extern "C" {
+        fn f();
         fn f();
-        fn f() {}
     }
 }
diff --git a/src/test/ui/parser/fn-header-semantic-fail.rs b/src/test/ui/parser/fn-header-semantic-fail.rs
index c327667f4cd..0bbaeec0c7f 100644
--- a/src/test/ui/parser/fn-header-semantic-fail.rs
+++ b/src/test/ui/parser/fn-header-semantic-fail.rs
@@ -47,7 +47,7 @@ fn main() {
         //~^ ERROR functions cannot be both `const` and `async`
     }
 
-    extern {
+    extern "C" {
         async fn fe1(); //~ ERROR functions in `extern` blocks cannot have qualifiers
         unsafe fn fe2(); //~ ERROR functions in `extern` blocks cannot have qualifiers
         const fn fe3(); //~ ERROR functions in `extern` blocks cannot have qualifiers
diff --git a/src/test/ui/parser/fn-header-semantic-fail.stderr b/src/test/ui/parser/fn-header-semantic-fail.stderr
index 2f11f95bf4a..4fde243b2f8 100644
--- a/src/test/ui/parser/fn-header-semantic-fail.stderr
+++ b/src/test/ui/parser/fn-header-semantic-fail.stderr
@@ -105,8 +105,8 @@ LL |         const async unsafe extern "C" fn fi5() {}
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/fn-header-semantic-fail.rs:51:18
    |
-LL |     extern {
-   |     ------ in this `extern` block
+LL |     extern "C" {
+   |     ---------- in this `extern` block
 LL |         async fn fe1();
    |                  ^^^
    |
@@ -118,8 +118,8 @@ LL |         fn fe1();
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/fn-header-semantic-fail.rs:52:19
    |
-LL |     extern {
-   |     ------ in this `extern` block
+LL |     extern "C" {
+   |     ---------- in this `extern` block
 LL |         async fn fe1();
 LL |         unsafe fn fe2();
    |                   ^^^
@@ -132,8 +132,8 @@ LL |         fn fe2();
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/fn-header-semantic-fail.rs:53:18
    |
-LL |     extern {
-   |     ------ in this `extern` block
+LL |     extern "C" {
+   |     ---------- in this `extern` block
 ...
 LL |         const fn fe3();
    |                  ^^^
@@ -146,8 +146,8 @@ LL |         fn fe3();
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/fn-header-semantic-fail.rs:54:23
    |
-LL |     extern {
-   |     ------ in this `extern` block
+LL |     extern "C" {
+   |     ---------- in this `extern` block
 ...
 LL |         extern "C" fn fe4();
    |                       ^^^
@@ -160,8 +160,8 @@ LL |         fn fe4();
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/fn-header-semantic-fail.rs:55:42
    |
-LL |     extern {
-   |     ------ in this `extern` block
+LL |     extern "C" {
+   |     ---------- in this `extern` block
 ...
 LL |         const async unsafe extern "C" fn fe5();
    |                                          ^^^
diff --git a/src/test/ui/parser/fn-header-syntactic-pass.rs b/src/test/ui/parser/fn-header-syntactic-pass.rs
index 9e44541993d..68f1f7901bb 100644
--- a/src/test/ui/parser/fn-header-syntactic-pass.rs
+++ b/src/test/ui/parser/fn-header-syntactic-pass.rs
@@ -37,11 +37,11 @@ fn syntax() {
         const async unsafe extern "C" fn f();
     }
 
-    extern {
-        async fn f();
-        unsafe fn f();
-        const fn f();
-        extern "C" fn f();
-        const async unsafe extern "C" fn f();
+    extern "C" {
+        fn f();
+        fn f();
+        fn f();
+        fn f();
+        fn f();
     }
 }
diff --git a/src/test/ui/parser/foreign-const-semantic-fail.rs b/src/test/ui/parser/foreign-const-semantic-fail.rs
index 82978e655ba..c9940b74aa2 100644
--- a/src/test/ui/parser/foreign-const-semantic-fail.rs
+++ b/src/test/ui/parser/foreign-const-semantic-fail.rs
@@ -1,6 +1,6 @@
 fn main() {}
 
-extern {
+extern "C" {
     const A: isize;
     //~^ ERROR extern items cannot be `const`
     const B: isize = 42;
diff --git a/src/test/ui/parser/foreign-const-semantic-fail.stderr b/src/test/ui/parser/foreign-const-semantic-fail.stderr
index f529b3ad87b..8dc66c0d012 100644
--- a/src/test/ui/parser/foreign-const-semantic-fail.stderr
+++ b/src/test/ui/parser/foreign-const-semantic-fail.stderr
@@ -21,8 +21,8 @@ LL |     const B: isize = 42;
 error: incorrect `static` inside `extern` block
   --> $DIR/foreign-const-semantic-fail.rs:6:11
    |
-LL | extern {
-   | ------ `extern` blocks define existing foreign statics and statics inside of them cannot have a body
+LL | extern "C" {
+   | ---------- `extern` blocks define existing foreign statics and statics inside of them cannot have a body
 ...
 LL |     const B: isize = 42;
    |           ^          -- the invalid body
diff --git a/src/test/ui/parser/foreign-const-syntactic-fail.rs b/src/test/ui/parser/foreign-const-syntactic-fail.rs
index a78f8b1623a..a6e77f84663 100644
--- a/src/test/ui/parser/foreign-const-syntactic-fail.rs
+++ b/src/test/ui/parser/foreign-const-syntactic-fail.rs
@@ -3,7 +3,7 @@
 fn main() {}
 
 #[cfg(FALSE)]
-extern {
+extern "C" {
     const A: isize; //~ ERROR extern items cannot be `const`
     const B: isize = 42; //~ ERROR extern items cannot be `const`
 }
diff --git a/src/test/ui/parser/foreign-static-semantic-fail.rs b/src/test/ui/parser/foreign-static-semantic-fail.rs
index 9abdf33df9c..3d427ed0efd 100644
--- a/src/test/ui/parser/foreign-static-semantic-fail.rs
+++ b/src/test/ui/parser/foreign-static-semantic-fail.rs
@@ -2,7 +2,7 @@
 
 fn main() {}
 
-extern {
+extern "C" {
     static X: u8 = 0; //~ ERROR incorrect `static` inside `extern` block
     static mut Y: u8 = 0; //~ ERROR incorrect `static` inside `extern` block
 }
diff --git a/src/test/ui/parser/foreign-static-semantic-fail.stderr b/src/test/ui/parser/foreign-static-semantic-fail.stderr
index 5942e3a9449..105508cfefa 100644
--- a/src/test/ui/parser/foreign-static-semantic-fail.stderr
+++ b/src/test/ui/parser/foreign-static-semantic-fail.stderr
@@ -1,8 +1,8 @@
 error: incorrect `static` inside `extern` block
   --> $DIR/foreign-static-semantic-fail.rs:6:12
    |
-LL | extern {
-   | ------ `extern` blocks define existing foreign statics and statics inside of them cannot have a body
+LL | extern "C" {
+   | ---------- `extern` blocks define existing foreign statics and statics inside of them cannot have a body
 LL |     static X: u8 = 0;
    |            ^       - the invalid body
    |            |
@@ -13,8 +13,8 @@ LL |     static X: u8 = 0;
 error: incorrect `static` inside `extern` block
   --> $DIR/foreign-static-semantic-fail.rs:7:16
    |
-LL | extern {
-   | ------ `extern` blocks define existing foreign statics and statics inside of them cannot have a body
+LL | extern "C" {
+   | ---------- `extern` blocks define existing foreign statics and statics inside of them cannot have a body
 LL |     static X: u8 = 0;
 LL |     static mut Y: u8 = 0;
    |                ^       - the invalid body
diff --git a/src/test/ui/parser/foreign-static-syntactic-pass.rs b/src/test/ui/parser/foreign-static-syntactic-pass.rs
index 2c805e8a0b7..59949634617 100644
--- a/src/test/ui/parser/foreign-static-syntactic-pass.rs
+++ b/src/test/ui/parser/foreign-static-syntactic-pass.rs
@@ -5,7 +5,7 @@
 fn main() {}
 
 #[cfg(FALSE)]
-extern {
-    static X: u8 = 0;
-    static mut Y: u8 = 0;
+extern "C" {
+    static X: u8;
+    static mut Y: u8;
 }
diff --git a/src/test/ui/parser/no-const-fn-in-extern-block.rs b/src/test/ui/parser/no-const-fn-in-extern-block.rs
index 4cae703a163..1993124edc3 100644
--- a/src/test/ui/parser/no-const-fn-in-extern-block.rs
+++ b/src/test/ui/parser/no-const-fn-in-extern-block.rs
@@ -1,4 +1,4 @@
-extern {
+extern "C" {
     const fn foo();
     //~^ ERROR functions in `extern` blocks cannot have qualifiers
     const unsafe fn bar();
diff --git a/src/test/ui/parser/no-const-fn-in-extern-block.stderr b/src/test/ui/parser/no-const-fn-in-extern-block.stderr
index af92f2d94f2..04fc8c85e4f 100644
--- a/src/test/ui/parser/no-const-fn-in-extern-block.stderr
+++ b/src/test/ui/parser/no-const-fn-in-extern-block.stderr
@@ -1,8 +1,8 @@
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/no-const-fn-in-extern-block.rs:2:14
    |
-LL | extern {
-   | ------ in this `extern` block
+LL | extern "C" {
+   | ---------- in this `extern` block
 LL |     const fn foo();
    |              ^^^
    |
@@ -14,8 +14,8 @@ LL |     fn foo();
 error: functions in `extern` blocks cannot have qualifiers
   --> $DIR/no-const-fn-in-extern-block.rs:4:21
    |
-LL | extern {
-   | ------ in this `extern` block
+LL | extern "C" {
+   | ---------- in this `extern` block
 ...
 LL |     const unsafe fn bar();
    |                     ^^^
diff --git a/src/test/ui/parser/self-param-semantic-fail.rs b/src/test/ui/parser/self-param-semantic-fail.rs
index 5676971b01a..621aab279aa 100644
--- a/src/test/ui/parser/self-param-semantic-fail.rs
+++ b/src/test/ui/parser/self-param-semantic-fail.rs
@@ -23,7 +23,7 @@ fn free() {
     //~^ ERROR `self` parameter is only allowed in associated functions
 }
 
-extern {
+extern "C" {
     fn f1(self);
     //~^ ERROR `self` parameter is only allowed in associated functions
     fn f2(mut self);
@@ -40,8 +40,8 @@ extern {
     fn f7(self: u8);
     //~^ ERROR `self` parameter is only allowed in associated functions
     fn f8(mut self: u8);
-    //~^ ERROR `self` parameter is only allowed in associated functions
-    //~| ERROR patterns aren't allowed in
+//~^ ERROR `self` parameter is only allowed in associated functions
+//~| ERROR patterns aren't allowed in
 }
 
 type X1 = fn(self);
diff --git a/src/test/ui/parser/self-param-syntactic-pass.rs b/src/test/ui/parser/self-param-syntactic-pass.rs
index 9e215e6cdd4..d7bb7863c07 100644
--- a/src/test/ui/parser/self-param-syntactic-pass.rs
+++ b/src/test/ui/parser/self-param-syntactic-pass.rs
@@ -18,7 +18,7 @@ fn free() {
 }
 
 #[cfg(FALSE)]
-extern {
+extern "C" {
     fn f(self);
     fn f(mut self);
     fn f(&self);
diff --git a/src/test/ui/parser/unsafe-foreign-mod.rs b/src/test/ui/parser/unsafe-foreign-mod.rs
index 872af95bd22..eab134a4a4d 100644
--- a/src/test/ui/parser/unsafe-foreign-mod.rs
+++ b/src/test/ui/parser/unsafe-foreign-mod.rs
@@ -1,7 +1,3 @@
-unsafe extern {
-    //~^ ERROR extern block cannot be declared unsafe
-}
-
 unsafe extern "C" {
     //~^ ERROR extern block cannot be declared unsafe
 }
diff --git a/src/test/ui/parser/unsafe-foreign-mod.stderr b/src/test/ui/parser/unsafe-foreign-mod.stderr
index 5e10988051e..4acf72c5dae 100644
--- a/src/test/ui/parser/unsafe-foreign-mod.stderr
+++ b/src/test/ui/parser/unsafe-foreign-mod.stderr
@@ -1,14 +1,8 @@
 error: extern block cannot be declared unsafe
   --> $DIR/unsafe-foreign-mod.rs:1:1
    |
-LL | unsafe extern {
-   | ^^^^^^
-
-error: extern block cannot be declared unsafe
-  --> $DIR/unsafe-foreign-mod.rs:5:1
-   |
 LL | unsafe extern "C" {
    | ^^^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
diff --git a/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs b/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs
index aa85f6d6b52..404f4090755 100644
--- a/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs
+++ b/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs
@@ -20,22 +20,22 @@ extern "C" fn f2_3(..., x: isize) {}
 //~^ ERROR only foreign or `unsafe extern "C" functions may be C-variadic
 //~| ERROR `...` must be the last argument of a C-variadic function
 
-extern fn f3_1(x: isize, ...) {}
+extern "C" fn f3_1(x: isize, ...) {}
 //~^ ERROR only foreign or `unsafe extern "C" functions may be C-variadic
 
-extern fn f3_2(...) {}
+extern "C" fn f3_2(...) {}
 //~^ ERROR only foreign or `unsafe extern "C" functions may be C-variadic
 //~| ERROR C-variadic function must be declared with at least one named argument
 
-extern fn f3_3(..., x: isize) {}
+extern "C" fn f3_3(..., x: isize) {}
 //~^ ERROR only foreign or `unsafe extern "C" functions may be C-variadic
 //~| ERROR `...` must be the last argument of a C-variadic function
 
-extern {
+extern "C" {
     fn e_f1(...);
     //~^ ERROR C-variadic function must be declared with at least one named argument
     fn e_f2(..., x: isize);
-    //~^ ERROR `...` must be the last argument of a C-variadic function
+//~^ ERROR `...` must be the last argument of a C-variadic function
 }
 
 struct X;
diff --git a/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr b/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr
index 3f3ddfed14a..ebfe4979fb6 100644
--- a/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr
+++ b/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr
@@ -47,34 +47,34 @@ LL | extern "C" fn f2_3(..., x: isize) {}
    |                    ^^^
 
 error: only foreign or `unsafe extern "C" functions may be C-variadic
-  --> $DIR/variadic-ffi-semantic-restrictions.rs:23:26
+  --> $DIR/variadic-ffi-semantic-restrictions.rs:23:30
    |
-LL | extern fn f3_1(x: isize, ...) {}
-   |                          ^^^
+LL | extern "C" fn f3_1(x: isize, ...) {}
+   |                              ^^^
 
 error: C-variadic function must be declared with at least one named argument
-  --> $DIR/variadic-ffi-semantic-restrictions.rs:26:16
+  --> $DIR/variadic-ffi-semantic-restrictions.rs:26:20
    |
-LL | extern fn f3_2(...) {}
-   |                ^^^
+LL | extern "C" fn f3_2(...) {}
+   |                    ^^^
 
 error: only foreign or `unsafe extern "C" functions may be C-variadic
-  --> $DIR/variadic-ffi-semantic-restrictions.rs:26:16
+  --> $DIR/variadic-ffi-semantic-restrictions.rs:26:20
    |
-LL | extern fn f3_2(...) {}
-   |                ^^^
+LL | extern "C" fn f3_2(...) {}
+   |                    ^^^
 
 error: `...` must be the last argument of a C-variadic function
-  --> $DIR/variadic-ffi-semantic-restrictions.rs:30:16
+  --> $DIR/variadic-ffi-semantic-restrictions.rs:30:20
    |
-LL | extern fn f3_3(..., x: isize) {}
-   |                ^^^
+LL | extern "C" fn f3_3(..., x: isize) {}
+   |                    ^^^
 
 error: only foreign or `unsafe extern "C" functions may be C-variadic
-  --> $DIR/variadic-ffi-semantic-restrictions.rs:30:16
+  --> $DIR/variadic-ffi-semantic-restrictions.rs:30:20
    |
-LL | extern fn f3_3(..., x: isize) {}
-   |                ^^^
+LL | extern "C" fn f3_3(..., x: isize) {}
+   |                    ^^^
 
 error: C-variadic function must be declared with at least one named argument
   --> $DIR/variadic-ffi-semantic-restrictions.rs:35:13