about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0633.md2
-rw-r--r--library/std/src/keyword_docs.rs2
-rw-r--r--library/std/src/sys/unix/weak.rs2
-rw-r--r--src/test/codegen/debug-linkage-name.rs6
-rw-r--r--src/test/codegen/export-no-mangle.rs8
-rw-r--r--src/test/codegen/issue-47278.rs2
-rw-r--r--src/test/codegen/repr-transparent-aggregates-1.rs16
-rw-r--r--src/test/codegen/repr-transparent.rs34
-rw-r--r--src/test/codegen/target-cpu-on-functions.rs2
-rw-r--r--src/test/codegen/unwind-extern-exports.rs2
-rw-r--r--src/test/incremental/hashes/inherent_impls.rs2
-rw-r--r--src/test/incremental/hashes/trait_defs.rs2
-rw-r--r--src/test/run-make-fulldeps/cdylib-dylib-linkage/foo.rs4
-rw-r--r--src/test/run-make-fulldeps/cdylib-fewer-symbols/foo.rs2
-rw-r--r--src/test/run-make-fulldeps/cdylib/foo.rs4
-rw-r--r--src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs2
-rw-r--r--src/test/run-make-fulldeps/glibc-staticlib-args/library.rs2
-rw-r--r--src/test/run-make-fulldeps/issue-14500/foo.rs2
-rw-r--r--src/test/run-make-fulldeps/sanitizer-cdylib-link/library.rs2
-rw-r--r--src/test/run-make-fulldeps/sanitizer-dylib-link/library.rs2
-rw-r--r--src/test/run-make-fulldeps/sanitizer-staticlib-link/library.rs2
-rw-r--r--src/test/run-make-fulldeps/static-dylib-by-default/bar.rs2
-rw-r--r--src/test/run-make-fulldeps/std-core-cycle/foo.rs2
-rw-r--r--src/test/ui/abi/extern/extern-call-direct.rs2
-rw-r--r--src/test/ui/auxiliary/lto-duplicate-symbols1.rs2
-rw-r--r--src/test/ui/auxiliary/lto-duplicate-symbols2.rs2
-rw-r--r--src/test/ui/consts/auxiliary/cci_const.rs2
-rw-r--r--src/test/ui/consts/auxiliary/issue-63226.rs4
-rw-r--r--src/test/ui/consts/const-cast.rs2
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs6
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs4
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr6
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs2
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn.rs12
-rw-r--r--src/test/ui/consts/const-extern-function.rs2
-rw-r--r--src/test/ui/cross-crate/auxiliary/cci_const.rs2
-rw-r--r--src/test/ui/duplicate/dupe-symbols-2.rs4
-rw-r--r--src/test/ui/duplicate/dupe-symbols-2.stderr4
-rw-r--r--src/test/ui/extern/auxiliary/extern-take-value.rs8
-rw-r--r--src/test/ui/extern/auxiliary/extern_calling_convention.rs2
-rw-r--r--src/test/ui/extern/extern-1.rs2
-rw-r--r--src/test/ui/extern/extern-compare-with-return-type.rs20
-rw-r--r--src/test/ui/extern/extern-main-fn.rs2
-rw-r--r--src/test/ui/extern/extern-main-fn.stderr4
-rw-r--r--src/test/ui/extern/extern-methods.rs4
-rw-r--r--src/test/ui/extern/extern-rust.rs2
-rw-r--r--src/test/ui/extern/extern-wrong-value-type.rs2
-rw-r--r--src/test/ui/extern/issue-10025.rs2
-rw-r--r--src/test/ui/functions-closures/auxiliary/fn-abi.rs2
-rw-r--r--src/test/ui/generics/generic-no-mangle.fixed2
-rw-r--r--src/test/ui/generics/generic-no-mangle.rs2
-rw-r--r--src/test/ui/generics/generic-no-mangle.stderr4
-rw-r--r--src/test/ui/hashmap/hashmap-memory.rs2
-rw-r--r--src/test/ui/issues/auxiliary/issue-13620-1.rs4
-rw-r--r--src/test/ui/issues/issue-10764.rs2
-rw-r--r--src/test/ui/issues/issue-15562.rs2
-rw-r--r--src/test/ui/issues/issue-26997.rs2
-rw-r--r--src/test/ui/issues/issue-28600.rs2
-rw-r--r--src/test/ui/issues/issue-51907.rs8
-rw-r--r--src/test/ui/lint/lint-ctypes-fn.rs8
-rw-r--r--src/test/ui/mir/mir_codegen_calls.rs2
-rw-r--r--src/test/ui/no_owned_box_lang_item.rs2
-rw-r--r--src/test/ui/nullable-pointer-size.rs2
-rw-r--r--src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs6
-rw-r--r--src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs6
-rw-r--r--src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs6
-rw-r--r--src/test/ui/parser/bad-lit-suffixes.stderr13
-rw-r--r--src/test/ui/proc-macro/signature.rs2
-rw-r--r--src/test/ui/proc-macro/signature.stderr2
-rw-r--r--src/test/ui/proc-macro/span-preservation.rs2
-rw-r--r--src/test/ui/proc-macro/span-preservation.stderr4
-rw-r--r--src/test/ui/range/issue-54505-no-std.rs2
-rw-r--r--src/test/ui/signal-alternate-stack-cleanup.rs4
-rw-r--r--src/test/ui/structs-enums/class-dtor.rs4
-rw-r--r--src/test/ui/symbol-names/impl1.rs2
-rw-r--r--src/test/ui/type-param.rs2
-rw-r--r--src/test/ui/type-params-in-for-each.rs2
-rw-r--r--src/test/ui/unique/unique-ffi-symbols.rs8
78 files changed, 155 insertions, 166 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0633.md b/compiler/rustc_error_codes/src/error_codes/E0633.md
index 7f488cde664..4d1f0c47829 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0633.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0633.md
@@ -6,7 +6,7 @@ Erroneous code example:
 #![feature(unwind_attributes)]
 
 #[unwind()] // error: expected one argument
-pub extern fn something() {}
+pub extern "C" fn something() {}
 
 fn main() {}
 ```
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs
index 417a54e9dff..6b06539a094 100644
--- a/library/std/src/keyword_docs.rs
+++ b/library/std/src/keyword_docs.rs
@@ -401,7 +401,7 @@ mod enum_keyword {}
 ///
 /// ```rust
 /// #[no_mangle]
-/// pub extern fn callable_from_c(x: i32) -> bool {
+/// pub extern "C" fn callable_from_c(x: i32) -> bool {
 ///     x % 3 == 0
 /// }
 /// ```
diff --git a/library/std/src/sys/unix/weak.rs b/library/std/src/sys/unix/weak.rs
index e93a4972caa..432fe4c33bc 100644
--- a/library/std/src/sys/unix/weak.rs
+++ b/library/std/src/sys/unix/weak.rs
@@ -28,7 +28,7 @@ use crate::sync::atomic::{self, AtomicUsize, Ordering};
 
 macro_rules! weak {
     (fn $name:ident($($t:ty),*) -> $ret:ty) => (
-        static $name: crate::sys::weak::Weak<unsafe extern fn($($t),*) -> $ret> =
+        static $name: crate::sys::weak::Weak<unsafe extern "C" fn($($t),*) -> $ret> =
             crate::sys::weak::Weak::new(concat!(stringify!($name), '\0'));
     )
 }
diff --git a/src/test/codegen/debug-linkage-name.rs b/src/test/codegen/debug-linkage-name.rs
index 0d7dca3aba3..9011a7da51d 100644
--- a/src/test/codegen/debug-linkage-name.rs
+++ b/src/test/codegen/debug-linkage-name.rs
@@ -26,17 +26,17 @@ pub mod xyz {
     // CHECK: !DISubprogram(name: "e",
     // CHECK:               linkageName:
     // CHECK-SAME:          line: 29,
-    pub extern fn e() {}
+    pub extern "C" fn e() {}
 
     // CHECK: !DISubprogram(name: "f",
     // CHECK-NOT:           linkageName:
     // CHECK-SAME:          line: 35,
     #[no_mangle]
-    pub extern fn f() {}
+    pub extern "C" fn f() {}
 
     // CHECK: !DISubprogram(name: "g",
     // CHECK-NOT:           linkageName:
     // CHECK-SAME:          line: 41,
     #[export_name = "g"]
-    pub extern fn g() {}
+    pub extern "C" fn g() {}
 }
diff --git a/src/test/codegen/export-no-mangle.rs b/src/test/codegen/export-no-mangle.rs
index 59e97601c83..a89d48ee153 100644
--- a/src/test/codegen/export-no-mangle.rs
+++ b/src/test/codegen/export-no-mangle.rs
@@ -13,19 +13,19 @@ mod private {
 
     // CHECK: void @a()
     #[no_mangle]
-    pub extern fn a() {}
+    pub extern "C" fn a() {}
 
     // CHECK: void @b()
     #[export_name = "b"]
-    extern fn b() {}
+    extern "C" fn b() {}
 
     // CHECK: void @c()
     #[export_name = "c"]
     #[inline]
-    extern fn c() {}
+    extern "C" fn c() {}
 
     // CHECK: void @d()
     #[export_name = "d"]
     #[inline(always)]
-    extern fn d() {}
+    extern "C" fn d() {}
 }
diff --git a/src/test/codegen/issue-47278.rs b/src/test/codegen/issue-47278.rs
index 590e8ea8502..9076274f45e 100644
--- a/src/test/codegen/issue-47278.rs
+++ b/src/test/codegen/issue-47278.rs
@@ -6,4 +6,4 @@ pub struct Foo(u64);
 
 // CHECK: define {{.*}} @foo(
 #[no_mangle]
-pub extern fn foo(_: Foo) -> Foo { loop {} }
+pub extern "C" fn foo(_: Foo) -> Foo { loop {} }
diff --git a/src/test/codegen/repr-transparent-aggregates-1.rs b/src/test/codegen/repr-transparent-aggregates-1.rs
index 59f29e756fc..2b8d3c8bc1d 100644
--- a/src/test/codegen/repr-transparent-aggregates-1.rs
+++ b/src/test/codegen/repr-transparent-aggregates-1.rs
@@ -36,19 +36,19 @@ pub enum TeBigS {
 
 // CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS:.*]], %BigS* [[BIGS_ARG_ATTRS1:.*]] byval(%BigS) [[BIGS_ARG_ATTRS2:.*]])
 #[no_mangle]
-pub extern fn test_BigS(_: BigS) -> BigS { loop {} }
+pub extern "C" fn test_BigS(_: BigS) -> BigS { loop {} }
 
 // CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS]], %TsBigS* [[BIGS_ARG_ATTRS1]] byval(%TsBigS) [[BIGS_ARG_ATTRS2:.*]])
 #[no_mangle]
-pub extern fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
+pub extern "C" fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
 
 // CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS]], %TuBigS* [[BIGS_ARG_ATTRS1]] byval(%TuBigS) [[BIGS_ARG_ATTRS2:.*]])
 #[no_mangle]
-pub extern fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
+pub extern "C" fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
 
 // CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS]], %"TeBigS::Variant"* [[BIGS_ARG_ATTRS1]] byval(%"TeBigS::Variant") [[BIGS_ARG_ATTRS2]])
 #[no_mangle]
-pub extern fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
+pub extern "C" fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
 
 
 #[derive(Clone, Copy)]
@@ -72,16 +72,16 @@ pub enum TeBigU {
 
 // CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], %BigU* [[BIGU_ARG_ATTRS1:.*]] byval(%BigU) [[BIGU_ARG_ATTRS2:.*]])
 #[no_mangle]
-pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
+pub extern "C" fn test_BigU(_: BigU) -> BigU { loop {} }
 
 // CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS:.*]], %TsBigU* [[BIGU_ARG_ATTRS1]] byval(%TsBigU) [[BIGU_ARG_ATTRS2]])
 #[no_mangle]
-pub extern fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
+pub extern "C" fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
 
 // CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS]], %TuBigU* [[BIGU_ARG_ATTRS1]] byval(%TuBigU) [[BIGU_ARG_ATTRS2]])
 #[no_mangle]
-pub extern fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
+pub extern "C" fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
 
 // CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS]], %"TeBigU::Variant"* [[BIGU_ARG_ATTRS1]] byval(%"TeBigU::Variant") [[BIGU_ARG_ATTRS2]])
 #[no_mangle]
-pub extern fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }
+pub extern "C" fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }
diff --git a/src/test/codegen/repr-transparent.rs b/src/test/codegen/repr-transparent.rs
index 7647e019876..29997313511 100644
--- a/src/test/codegen/repr-transparent.rs
+++ b/src/test/codegen/repr-transparent.rs
@@ -19,21 +19,21 @@ pub struct F32(f32);
 
 // CHECK: define float @test_F32(float %_1)
 #[no_mangle]
-pub extern fn test_F32(_: F32) -> F32 { loop {} }
+pub extern "C" fn test_F32(_: F32) -> F32 { loop {} }
 
 #[repr(transparent)]
 pub struct Ptr(*mut u8);
 
 // CHECK: define i8* @test_Ptr(i8* %_1)
 #[no_mangle]
-pub extern fn test_Ptr(_: Ptr) -> Ptr { loop {} }
+pub extern "C" fn test_Ptr(_: Ptr) -> Ptr { loop {} }
 
 #[repr(transparent)]
 pub struct WithZst(u64, Zst1);
 
 // CHECK: define i64 @test_WithZst(i64 %_1)
 #[no_mangle]
-pub extern fn test_WithZst(_: WithZst) -> WithZst { loop {} }
+pub extern "C" fn test_WithZst(_: WithZst) -> WithZst { loop {} }
 
 #[repr(transparent)]
 pub struct WithZeroSizedArray(*const f32, [i8; 0]);
@@ -41,14 +41,14 @@ pub struct WithZeroSizedArray(*const f32, [i8; 0]);
 // Apparently we use i32* when newtype-unwrapping f32 pointers. Whatever.
 // CHECK: define i32* @test_WithZeroSizedArray(i32* %_1)
 #[no_mangle]
-pub extern fn test_WithZeroSizedArray(_: WithZeroSizedArray) -> WithZeroSizedArray { loop {} }
+pub extern "C" fn test_WithZeroSizedArray(_: WithZeroSizedArray) -> WithZeroSizedArray { loop {} }
 
 #[repr(transparent)]
 pub struct Generic<T>(T);
 
 // CHECK: define double @test_Generic(double %_1)
 #[no_mangle]
-pub extern fn test_Generic(_: Generic<f64>) -> Generic<f64> { loop {} }
+pub extern "C" fn test_Generic(_: Generic<f64>) -> Generic<f64> { loop {} }
 
 #[repr(transparent)]
 pub struct GenericPlusZst<T>(T, Zst2);
@@ -58,14 +58,14 @@ pub enum Bool { True, False, FileNotFound }
 
 // CHECK: define{{( zeroext)?}} i8 @test_Gpz(i8{{( zeroext)?}} %_1)
 #[no_mangle]
-pub extern fn test_Gpz(_: GenericPlusZst<Bool>) -> GenericPlusZst<Bool> { loop {} }
+pub extern "C" fn test_Gpz(_: GenericPlusZst<Bool>) -> GenericPlusZst<Bool> { loop {} }
 
 #[repr(transparent)]
 pub struct LifetimePhantom<'a, T: 'a>(*const T, PhantomData<&'a T>);
 
 // CHECK: define i16* @test_LifetimePhantom(i16* %_1)
 #[no_mangle]
-pub extern fn test_LifetimePhantom(_: LifetimePhantom<i16>) -> LifetimePhantom<i16> { loop {} }
+pub extern "C" fn test_LifetimePhantom(_: LifetimePhantom<i16>) -> LifetimePhantom<i16> { loop {} }
 
 // This works despite current alignment resrictions because PhantomData is always align(1)
 #[repr(transparent)]
@@ -75,28 +75,28 @@ pub struct Px;
 
 // CHECK: define float @test_UnitPhantom(float %_1)
 #[no_mangle]
-pub extern fn test_UnitPhantom(_: UnitPhantom<f32, Px>) -> UnitPhantom<f32, Px> { loop {} }
+pub extern "C" fn test_UnitPhantom(_: UnitPhantom<f32, Px>) -> UnitPhantom<f32, Px> { loop {} }
 
 #[repr(transparent)]
 pub struct TwoZsts(Zst1, i8, Zst2);
 
 // CHECK: define{{( signext)?}} i8 @test_TwoZsts(i8{{( signext)?}} %_1)
 #[no_mangle]
-pub extern fn test_TwoZsts(_: TwoZsts) -> TwoZsts { loop {} }
+pub extern "C" fn test_TwoZsts(_: TwoZsts) -> TwoZsts { loop {} }
 
 #[repr(transparent)]
 pub struct Nested1(Zst2, Generic<f64>);
 
 // CHECK: define double @test_Nested1(double %_1)
 #[no_mangle]
-pub extern fn test_Nested1(_: Nested1) -> Nested1 { loop {} }
+pub extern "C" fn test_Nested1(_: Nested1) -> Nested1 { loop {} }
 
 #[repr(transparent)]
 pub struct Nested2(Nested1, Zst1);
 
 // CHECK: define double @test_Nested2(double %_1)
 #[no_mangle]
-pub extern fn test_Nested2(_: Nested2) -> Nested2 { loop {} }
+pub extern "C" fn test_Nested2(_: Nested2) -> Nested2 { loop {} }
 
 #[repr(simd)]
 struct f32x4(f32, f32, f32, f32);
@@ -106,7 +106,7 @@ pub struct Vector(f32x4);
 
 // CHECK: define <4 x float> @test_Vector(<4 x float> %_1)
 #[no_mangle]
-pub extern fn test_Vector(_: Vector) -> Vector { loop {} }
+pub extern "C" fn test_Vector(_: Vector) -> Vector { loop {} }
 
 trait Mirror { type It: ?Sized; }
 impl<T: ?Sized> Mirror for T { type It = Self; }
@@ -116,7 +116,7 @@ pub struct StructWithProjection(<f32 as Mirror>::It);
 
 // CHECK: define float @test_Projection(float %_1)
 #[no_mangle]
-pub extern fn test_Projection(_: StructWithProjection) -> StructWithProjection { loop {} }
+pub extern "C" fn test_Projection(_: StructWithProjection) -> StructWithProjection { loop {} }
 
 #[repr(transparent)]
 pub enum EnumF32 {
@@ -125,7 +125,7 @@ pub enum EnumF32 {
 
 // CHECK: define float @test_EnumF32(float %_1)
 #[no_mangle]
-pub extern fn test_EnumF32(_: EnumF32) -> EnumF32 { loop {} }
+pub extern "C" fn test_EnumF32(_: EnumF32) -> EnumF32 { loop {} }
 
 #[repr(transparent)]
 pub enum EnumF32WithZsts {
@@ -134,7 +134,7 @@ pub enum EnumF32WithZsts {
 
 // CHECK: define float @test_EnumF32WithZsts(float %_1)
 #[no_mangle]
-pub extern fn test_EnumF32WithZsts(_: EnumF32WithZsts) -> EnumF32WithZsts { loop {} }
+pub extern "C" fn test_EnumF32WithZsts(_: EnumF32WithZsts) -> EnumF32WithZsts { loop {} }
 
 #[repr(transparent)]
 pub union UnionF32 {
@@ -143,7 +143,7 @@ pub union UnionF32 {
 
 // CHECK: define float @test_UnionF32(float %_1)
 #[no_mangle]
-pub extern fn test_UnionF32(_: UnionF32) -> UnionF32 { loop {} }
+pub extern "C" fn test_UnionF32(_: UnionF32) -> UnionF32 { loop {} }
 
 #[repr(transparent)]
 pub union UnionF32WithZsts {
@@ -154,7 +154,7 @@ pub union UnionF32WithZsts {
 
 // CHECK: define float @test_UnionF32WithZsts(float %_1)
 #[no_mangle]
-pub extern fn test_UnionF32WithZsts(_: UnionF32WithZsts) -> UnionF32WithZsts { loop {} }
+pub extern "C" fn test_UnionF32WithZsts(_: UnionF32WithZsts) -> UnionF32WithZsts { loop {} }
 
 
 // All that remains to be tested are aggregates. They are tested in separate files called repr-
diff --git a/src/test/codegen/target-cpu-on-functions.rs b/src/test/codegen/target-cpu-on-functions.rs
index 523216deb84..7544ac01309 100644
--- a/src/test/codegen/target-cpu-on-functions.rs
+++ b/src/test/codegen/target-cpu-on-functions.rs
@@ -9,7 +9,7 @@
 
 // CHECK-LABEL: define {{.*}} @exported() {{.*}} #0
 #[no_mangle]
-pub extern fn exported() {
+pub extern "C" fn exported() {
     not_exported();
 }
 
diff --git a/src/test/codegen/unwind-extern-exports.rs b/src/test/codegen/unwind-extern-exports.rs
index e5a2936b924..487de20671a 100644
--- a/src/test/codegen/unwind-extern-exports.rs
+++ b/src/test/codegen/unwind-extern-exports.rs
@@ -11,7 +11,7 @@
 // "C" ABI
 // pub extern fn foo() {} // FIXME right now we don't abort-on-panic but add `nounwind` nevertheless
 #[unwind(allowed)]
-pub extern fn foo_allowed() {}
+pub extern "C" fn foo_allowed() {}
 
 // "Rust"
 // (`extern "Rust"` could be removed as all `fn` get it implicitly; we leave it in for clarity.)
diff --git a/src/test/incremental/hashes/inherent_impls.rs b/src/test/incremental/hashes/inherent_impls.rs
index fcd12ad30eb..2e98abae58b 100644
--- a/src/test/incremental/hashes/inherent_impls.rs
+++ b/src/test/incremental/hashes/inherent_impls.rs
@@ -271,7 +271,7 @@ impl Foo {
 impl Foo {
     #[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,fn_sig,typeck")]
     #[rustc_clean(cfg="cfail3")]
-    pub extern fn make_method_extern(&self) { }
+    pub extern "C" fn make_method_extern(&self) { }
 }
 
 
diff --git a/src/test/incremental/hashes/trait_defs.rs b/src/test/incremental/hashes/trait_defs.rs
index aa39ea88e0e..4dab032e47f 100644
--- a/src/test/incremental/hashes/trait_defs.rs
+++ b/src/test/incremental/hashes/trait_defs.rs
@@ -312,7 +312,7 @@ trait TraitAddExternModifier {
 trait TraitAddExternModifier {
     #[rustc_dirty(label="hir_owner", cfg="cfail2")]
     #[rustc_clean(label="hir_owner", cfg="cfail3")]
-    extern fn method();
+    extern "C" fn method();
 }
 
 
diff --git a/src/test/run-make-fulldeps/cdylib-dylib-linkage/foo.rs b/src/test/run-make-fulldeps/cdylib-dylib-linkage/foo.rs
index c2cc3afcc13..c4069495aaf 100644
--- a/src/test/run-make-fulldeps/cdylib-dylib-linkage/foo.rs
+++ b/src/test/run-make-fulldeps/cdylib-dylib-linkage/foo.rs
@@ -3,11 +3,11 @@
 extern crate bar;
 
 #[no_mangle]
-pub extern fn foo() {
+pub extern "C" fn foo() {
     bar::bar();
 }
 
 #[no_mangle]
-pub extern fn bar(a: u32, b: u32) -> u32 {
+pub extern "C" fn bar(a: u32, b: u32) -> u32 {
     a + b
 }
diff --git a/src/test/run-make-fulldeps/cdylib-fewer-symbols/foo.rs b/src/test/run-make-fulldeps/cdylib-fewer-symbols/foo.rs
index 5a6f7c45bd2..af37bc8e953 100644
--- a/src/test/run-make-fulldeps/cdylib-fewer-symbols/foo.rs
+++ b/src/test/run-make-fulldeps/cdylib-fewer-symbols/foo.rs
@@ -1,6 +1,6 @@
 #![crate_type = "cdylib"]
 
 #[no_mangle]
-pub extern fn foo() -> u32 {
+pub extern "C" fn foo() -> u32 {
     3
 }
diff --git a/src/test/run-make-fulldeps/cdylib/foo.rs b/src/test/run-make-fulldeps/cdylib/foo.rs
index c2cc3afcc13..c4069495aaf 100644
--- a/src/test/run-make-fulldeps/cdylib/foo.rs
+++ b/src/test/run-make-fulldeps/cdylib/foo.rs
@@ -3,11 +3,11 @@
 extern crate bar;
 
 #[no_mangle]
-pub extern fn foo() {
+pub extern "C" fn foo() {
     bar::bar();
 }
 
 #[no_mangle]
-pub extern fn bar(a: u32, b: u32) -> u32 {
+pub extern "C" fn bar(a: u32, b: u32) -> u32 {
     a + b
 }
diff --git a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs
index b24522e7f0e..34951dda3b6 100644
--- a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs
+++ b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs
@@ -3,6 +3,6 @@
 extern crate upstream;
 
 #[no_mangle]
-pub extern fn bar() {
+pub extern "C" fn bar() {
     upstream::foo();
 }
diff --git a/src/test/run-make-fulldeps/glibc-staticlib-args/library.rs b/src/test/run-make-fulldeps/glibc-staticlib-args/library.rs
index 991981dc096..5ab627a2ac1 100644
--- a/src/test/run-make-fulldeps/glibc-staticlib-args/library.rs
+++ b/src/test/run-make-fulldeps/glibc-staticlib-args/library.rs
@@ -1,4 +1,4 @@
 #[no_mangle]
-pub extern fn args_check() {
+pub extern "C" fn args_check() {
     assert_ne!(std::env::args_os().count(), 0);
 }
diff --git a/src/test/run-make-fulldeps/issue-14500/foo.rs b/src/test/run-make-fulldeps/issue-14500/foo.rs
index feebef1a6d0..7c19c1f2c67 100644
--- a/src/test/run-make-fulldeps/issue-14500/foo.rs
+++ b/src/test/run-make-fulldeps/issue-14500/foo.rs
@@ -1,5 +1,5 @@
 #[no_mangle]
-pub extern fn foo() {}
+pub extern "C" fn foo() {}
 
 #[no_mangle]
 pub static FOO_STATIC: u8 = 0;
diff --git a/src/test/run-make-fulldeps/sanitizer-cdylib-link/library.rs b/src/test/run-make-fulldeps/sanitizer-cdylib-link/library.rs
index bf11553ea6b..f2a52cb5ca1 100644
--- a/src/test/run-make-fulldeps/sanitizer-cdylib-link/library.rs
+++ b/src/test/run-make-fulldeps/sanitizer-cdylib-link/library.rs
@@ -1,5 +1,5 @@
 #[no_mangle]
-pub extern fn overflow() {
+pub extern "C" fn overflow() {
     let xs = [0, 1, 2, 3];
     let _y = unsafe { *xs.as_ptr().offset(4) };
 }
diff --git a/src/test/run-make-fulldeps/sanitizer-dylib-link/library.rs b/src/test/run-make-fulldeps/sanitizer-dylib-link/library.rs
index bf11553ea6b..f2a52cb5ca1 100644
--- a/src/test/run-make-fulldeps/sanitizer-dylib-link/library.rs
+++ b/src/test/run-make-fulldeps/sanitizer-dylib-link/library.rs
@@ -1,5 +1,5 @@
 #[no_mangle]
-pub extern fn overflow() {
+pub extern "C" fn overflow() {
     let xs = [0, 1, 2, 3];
     let _y = unsafe { *xs.as_ptr().offset(4) };
 }
diff --git a/src/test/run-make-fulldeps/sanitizer-staticlib-link/library.rs b/src/test/run-make-fulldeps/sanitizer-staticlib-link/library.rs
index bf11553ea6b..f2a52cb5ca1 100644
--- a/src/test/run-make-fulldeps/sanitizer-staticlib-link/library.rs
+++ b/src/test/run-make-fulldeps/sanitizer-staticlib-link/library.rs
@@ -1,5 +1,5 @@
 #[no_mangle]
-pub extern fn overflow() {
+pub extern "C" fn overflow() {
     let xs = [0, 1, 2, 3];
     let _y = unsafe { *xs.as_ptr().offset(4) };
 }
diff --git a/src/test/run-make-fulldeps/static-dylib-by-default/bar.rs b/src/test/run-make-fulldeps/static-dylib-by-default/bar.rs
index 5381e7f24bc..14421165e2d 100644
--- a/src/test/run-make-fulldeps/static-dylib-by-default/bar.rs
+++ b/src/test/run-make-fulldeps/static-dylib-by-default/bar.rs
@@ -3,6 +3,6 @@
 extern crate foo;
 
 #[no_mangle]
-pub extern fn bar() {
+pub extern "C" fn bar() {
     foo::foo();
 }
diff --git a/src/test/run-make-fulldeps/std-core-cycle/foo.rs b/src/test/run-make-fulldeps/std-core-cycle/foo.rs
index 3c80bc45a5b..6aa6e1ac3c5 100644
--- a/src/test/run-make-fulldeps/std-core-cycle/foo.rs
+++ b/src/test/run-make-fulldeps/std-core-cycle/foo.rs
@@ -6,6 +6,6 @@ extern crate bar;
 static A: bar::A = bar::A;
 
 #[no_mangle]
-pub extern fn a(a: u32, b: u32) -> u32 {
+pub extern "C" fn a(a: u32, b: u32) -> u32 {
     a / b
 }
diff --git a/src/test/ui/abi/extern/extern-call-direct.rs b/src/test/ui/abi/extern/extern-call-direct.rs
index 72041764215..19b901d49a4 100644
--- a/src/test/ui/abi/extern/extern-call-direct.rs
+++ b/src/test/ui/abi/extern/extern-call-direct.rs
@@ -2,7 +2,7 @@
 // Test direct calls to extern fns.
 
 
-extern fn f(x: usize) -> usize { x * 2 }
+extern "C" fn f(x: usize) -> usize { x * 2 }
 
 pub fn main() {
     let x = f(22);
diff --git a/src/test/ui/auxiliary/lto-duplicate-symbols1.rs b/src/test/ui/auxiliary/lto-duplicate-symbols1.rs
index 9d510f2626f..ec6d0560357 100644
--- a/src/test/ui/auxiliary/lto-duplicate-symbols1.rs
+++ b/src/test/ui/auxiliary/lto-duplicate-symbols1.rs
@@ -3,4 +3,4 @@
 #![crate_type = "rlib"]
 
 #[no_mangle]
-pub extern fn foo() {}
+pub extern "C" fn foo() {}
diff --git a/src/test/ui/auxiliary/lto-duplicate-symbols2.rs b/src/test/ui/auxiliary/lto-duplicate-symbols2.rs
index 9d510f2626f..ec6d0560357 100644
--- a/src/test/ui/auxiliary/lto-duplicate-symbols2.rs
+++ b/src/test/ui/auxiliary/lto-duplicate-symbols2.rs
@@ -3,4 +3,4 @@
 #![crate_type = "rlib"]
 
 #[no_mangle]
-pub extern fn foo() {}
+pub extern "C" fn foo() {}
diff --git a/src/test/ui/consts/auxiliary/cci_const.rs b/src/test/ui/consts/auxiliary/cci_const.rs
index af6a5ad8ed3..c83b3f4a5bb 100644
--- a/src/test/ui/consts/auxiliary/cci_const.rs
+++ b/src/test/ui/consts/auxiliary/cci_const.rs
@@ -1,4 +1,4 @@
-pub extern fn bar() {
+pub extern "C" fn bar() {
 }
 
 pub const foopy: &'static str = "hi there";
diff --git a/src/test/ui/consts/auxiliary/issue-63226.rs b/src/test/ui/consts/auxiliary/issue-63226.rs
index 39cc01a415e..2dc9539ba52 100644
--- a/src/test/ui/consts/auxiliary/issue-63226.rs
+++ b/src/test/ui/consts/auxiliary/issue-63226.rs
@@ -1,5 +1,5 @@
 pub struct VTable{
-    state:extern fn(),
+    state:extern "C" fn(),
 }
 
 impl VTable{
@@ -11,4 +11,4 @@ impl VTable{
         &VTable{state};
 }
 
-extern fn state() {}
+extern "C" fn state() {}
diff --git a/src/test/ui/consts/const-cast.rs b/src/test/ui/consts/const-cast.rs
index 0d8609e334a..abeb24121eb 100644
--- a/src/test/ui/consts/const-cast.rs
+++ b/src/test/ui/consts/const-cast.rs
@@ -7,7 +7,7 @@ struct TestStruct {
 
 unsafe impl Sync for TestStruct {}
 
-extern fn foo() {}
+extern "C" fn foo() {}
 const x: extern "C" fn() = foo;
 static y: TestStruct = TestStruct { x: x as *const u8 };
 
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
index e18e0a83573..ee07dfae47c 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
@@ -4,16 +4,16 @@ extern "C" {
     fn regular_in_block();
 }
 
-const extern fn bar() {
+const extern "C" fn bar() {
     unsafe {
         regular_in_block();
         //~^ ERROR: calls in constant functions
     }
 }
 
-extern fn regular() {}
+extern "C" fn regular() {}
 
-const extern fn foo() {
+const extern "C" fn foo() {
     unsafe {
         regular();
         //~^ ERROR: calls in constant functions
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
index 645a957949c..76380ebcb65 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
@@ -1,10 +1,10 @@
 #![feature(const_extern_fn)]
 
-const extern fn unsize(x: &[u8; 3]) -> &[u8] { x }
+const extern "C" fn unsize(x: &[u8; 3]) -> &[u8] { x }
 const unsafe extern "C" fn closure() -> fn() { || {} }
 //~^ ERROR function pointer
 //~| ERROR function pointer cast
-const unsafe extern fn use_float() { 1.0 + 1.0; }
+const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
 //~^ ERROR floating point arithmetic
 const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
 //~^ ERROR casting pointers to integers
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr
index 694e2290808..80d234b0e88 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr
@@ -17,10 +17,10 @@ LL | const unsafe extern "C" fn closure() -> fn() { || {} }
    = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
 
 error[E0658]: floating point arithmetic is not allowed in constant functions
-  --> $DIR/const-extern-fn-min-const-fn.rs:7:38
+  --> $DIR/const-extern-fn-min-const-fn.rs:7:42
    |
-LL | const unsafe extern fn use_float() { 1.0 + 1.0; }
-   |                                      ^^^^^^^^^
+LL | const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
+   |                                          ^^^^^^^^^
    |
    = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
    = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
index cab175bbfa8..71e6c2cb858 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
@@ -1,6 +1,6 @@
 #![feature(const_extern_fn)]
 
-const unsafe extern fn foo() -> usize { 5 }
+const unsafe extern "C" fn foo() -> usize { 5 }
 
 fn main() {
     let a: [u8; foo()];
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn.rs
index 1dc0f83cadf..2ce2eafd545 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn.rs
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn.rs
@@ -1,7 +1,7 @@
 // run-pass
 #![feature(const_extern_fn)]
 
-const extern fn foo1(val: u8) -> u8 {
+const extern "C" fn foo1(val: u8) -> u8 {
     val + 1
 }
 
@@ -9,7 +9,7 @@ const extern "C" fn foo2(val: u8) -> u8 {
     val + 1
 }
 
-const unsafe extern fn bar1(val: bool) -> bool {
+const unsafe extern "C" fn bar1(val: bool) -> bool {
     !val
 }
 
@@ -28,8 +28,8 @@ fn main() {
     assert!(bar1_res);
     assert_eq!(bar1_res, bar2_res);
 
-    let _foo1_cast: extern fn(u8) -> u8 = foo1;
-    let _foo2_cast: extern fn(u8) -> u8 = foo2;
-    let _bar1_cast: unsafe extern fn(bool) -> bool = bar1;
-    let _bar2_cast: unsafe extern fn(bool) -> bool = bar2;
+    let _foo1_cast: extern "C" fn(u8) -> u8 = foo1;
+    let _foo2_cast: extern "C" fn(u8) -> u8 = foo2;
+    let _bar1_cast: unsafe extern "C" fn(bool) -> bool = bar1;
+    let _bar2_cast: unsafe extern "C" fn(bool) -> bool = bar2;
 }
diff --git a/src/test/ui/consts/const-extern-function.rs b/src/test/ui/consts/const-extern-function.rs
index cfcf99b867a..01f487a7d75 100644
--- a/src/test/ui/consts/const-extern-function.rs
+++ b/src/test/ui/consts/const-extern-function.rs
@@ -1,7 +1,7 @@
 // run-pass
 #![allow(non_upper_case_globals)]
 
-extern fn foopy() {}
+extern "C" fn foopy() {}
 
 static f: extern "C" fn() = foopy;
 static s: S = S { f: foopy };
diff --git a/src/test/ui/cross-crate/auxiliary/cci_const.rs b/src/test/ui/cross-crate/auxiliary/cci_const.rs
index af6a5ad8ed3..c83b3f4a5bb 100644
--- a/src/test/ui/cross-crate/auxiliary/cci_const.rs
+++ b/src/test/ui/cross-crate/auxiliary/cci_const.rs
@@ -1,4 +1,4 @@
-pub extern fn bar() {
+pub extern "C" fn bar() {
 }
 
 pub const foopy: &'static str = "hi there";
diff --git a/src/test/ui/duplicate/dupe-symbols-2.rs b/src/test/ui/duplicate/dupe-symbols-2.rs
index d9edd77a199..e303a790baf 100644
--- a/src/test/ui/duplicate/dupe-symbols-2.rs
+++ b/src/test/ui/duplicate/dupe-symbols-2.rs
@@ -6,13 +6,13 @@
 
 pub mod a {
     #[no_mangle]
-    pub extern fn fail() {
+    pub extern "C" fn fail() {
     }
 }
 
 pub mod b {
     #[no_mangle]
-    pub extern fn fail() {
+    pub extern "C" fn fail() {
     //~^ symbol `fail` is already defined
     }
 }
diff --git a/src/test/ui/duplicate/dupe-symbols-2.stderr b/src/test/ui/duplicate/dupe-symbols-2.stderr
index 1b29edfb655..b132eae4b88 100644
--- a/src/test/ui/duplicate/dupe-symbols-2.stderr
+++ b/src/test/ui/duplicate/dupe-symbols-2.stderr
@@ -1,8 +1,8 @@
 error: symbol `fail` is already defined
   --> $DIR/dupe-symbols-2.rs:15:5
    |
-LL |     pub extern fn fail() {
-   |     ^^^^^^^^^^^^^^^^^^^^
+LL |     pub extern "C" fn fail() {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/extern/auxiliary/extern-take-value.rs b/src/test/ui/extern/auxiliary/extern-take-value.rs
index 869e794cc8a..56256aa1927 100644
--- a/src/test/ui/extern/auxiliary/extern-take-value.rs
+++ b/src/test/ui/extern/auxiliary/extern-take-value.rs
@@ -1,5 +1,5 @@
-pub extern fn f() -> i32 { 1 }
-pub extern fn g() -> i32 { 2 }
+pub extern "C" fn f() -> i32 { 1 }
+pub extern "C" fn g() -> i32 { 2 }
 
-pub fn get_f() -> extern fn() -> i32 { f }
-pub fn get_g() -> extern fn() -> i32 { g }
+pub fn get_f() -> extern "C" fn() -> i32 { f }
+pub fn get_g() -> extern "C" fn() -> i32 { g }
diff --git a/src/test/ui/extern/auxiliary/extern_calling_convention.rs b/src/test/ui/extern/auxiliary/extern_calling_convention.rs
index 968b1a25510..e24cf9fdaa0 100644
--- a/src/test/ui/extern/auxiliary/extern_calling_convention.rs
+++ b/src/test/ui/extern/auxiliary/extern_calling_convention.rs
@@ -15,7 +15,7 @@ pub extern "win64" fn foo(a: isize, b: isize, c: isize, d: isize) {
 
 #[inline(never)]
 #[cfg(not(target_arch = "x86_64"))]
-pub extern fn foo(a: isize, b: isize, c: isize, d: isize) {
+pub extern "C" fn foo(a: isize, b: isize, c: isize, d: isize) {
     assert_eq!(a, 1);
     assert_eq!(b, 2);
     assert_eq!(c, 3);
diff --git a/src/test/ui/extern/extern-1.rs b/src/test/ui/extern/extern-1.rs
index eb9aabc87bc..66e56050172 100644
--- a/src/test/ui/extern/extern-1.rs
+++ b/src/test/ui/extern/extern-1.rs
@@ -2,7 +2,7 @@
 #![allow(dead_code)]
 // pretty-expanded FIXME #23616
 
-extern fn f() {
+extern "C" fn f() {
 }
 
 pub fn main() {
diff --git a/src/test/ui/extern/extern-compare-with-return-type.rs b/src/test/ui/extern/extern-compare-with-return-type.rs
index 52b51bb943a..1ddfc77a4c4 100644
--- a/src/test/ui/extern/extern-compare-with-return-type.rs
+++ b/src/test/ui/extern/extern-compare-with-return-type.rs
@@ -3,23 +3,23 @@
 #![allow(non_camel_case_types)]
 
 // `dbg!()` differentiates these functions to ensure they won't be merged.
-extern fn voidret1() { dbg!() }
-extern fn voidret2() { dbg!() }
+extern "C" fn voidret1() { dbg!() }
+extern "C" fn voidret2() { dbg!() }
 
-extern fn uintret() -> usize { 22 }
+extern "C" fn uintret() -> usize { 22 }
 
-extern fn uintvoidret(_x: usize) {}
+extern "C" fn uintvoidret(_x: usize) {}
 
-extern fn uintuintuintuintret(x: usize, y: usize, z: usize) -> usize { x+y+z }
-type uintuintuintuintret = extern fn(usize,usize,usize) -> usize;
+extern "C" fn uintuintuintuintret(x: usize, y: usize, z: usize) -> usize { x+y+z }
+type uintuintuintuintret = extern "C" fn(usize,usize,usize) -> usize;
 
 pub fn main() {
-    assert!(voidret1 as extern fn() == voidret1 as extern fn());
-    assert!(voidret1 as extern fn() != voidret2 as extern fn());
+    assert!(voidret1 as extern "C" fn() == voidret1 as extern "C" fn());
+    assert!(voidret1 as extern "C" fn() != voidret2 as extern "C" fn());
 
-    assert!(uintret as extern fn() -> usize == uintret as extern fn() -> usize);
+    assert!(uintret as extern "C" fn() -> usize == uintret as extern "C" fn() -> usize);
 
-    assert!(uintvoidret as extern fn(usize) == uintvoidret as extern fn(usize));
+    assert!(uintvoidret as extern "C" fn(usize) == uintvoidret as extern "C" fn(usize));
 
     assert!(uintuintuintuintret as uintuintuintuintret ==
             uintuintuintuintret as uintuintuintuintret);
diff --git a/src/test/ui/extern/extern-main-fn.rs b/src/test/ui/extern/extern-main-fn.rs
index ddf2e136f03..bb1468a70fb 100644
--- a/src/test/ui/extern/extern-main-fn.rs
+++ b/src/test/ui/extern/extern-main-fn.rs
@@ -1 +1 @@
-extern fn main() {} //~ ERROR: `main` function has wrong type [E0580]
+extern "C" fn main() {} //~ ERROR: `main` function has wrong type [E0580]
diff --git a/src/test/ui/extern/extern-main-fn.stderr b/src/test/ui/extern/extern-main-fn.stderr
index 9c994985a3e..136c9575382 100644
--- a/src/test/ui/extern/extern-main-fn.stderr
+++ b/src/test/ui/extern/extern-main-fn.stderr
@@ -1,8 +1,8 @@
 error[E0580]: `main` function has wrong type
   --> $DIR/extern-main-fn.rs:1:1
    |
-LL | extern fn main() {}
-   | ^^^^^^^^^^^^^^^^ expected "Rust" fn, found "C" fn
+LL | extern "C" fn main() {}
+   | ^^^^^^^^^^^^^^^^^^^^ expected "Rust" fn, found "C" fn
    |
    = note: expected fn pointer `fn()`
               found fn pointer `extern "C" fn()`
diff --git a/src/test/ui/extern/extern-methods.rs b/src/test/ui/extern/extern-methods.rs
index 3c3e229104e..97559a68442 100644
--- a/src/test/ui/extern/extern-methods.rs
+++ b/src/test/ui/extern/extern-methods.rs
@@ -5,7 +5,7 @@
 
 trait A {
     extern "fastcall" fn test1(i: i32);
-    extern fn test2(i: i32);
+    extern "C" fn test2(i: i32);
 }
 
 struct S;
@@ -19,7 +19,7 @@ impl A for S {
     extern "fastcall" fn test1(i: i32) {
         assert_eq!(i, 1);
     }
-    extern fn test2(i: i32) {
+    extern "C" fn test2(i: i32) {
         assert_eq!(i, 2);
     }
 }
diff --git a/src/test/ui/extern/extern-rust.rs b/src/test/ui/extern/extern-rust.rs
index 0cb190257be..7cea8be5921 100644
--- a/src/test/ui/extern/extern-rust.rs
+++ b/src/test/ui/extern/extern-rust.rs
@@ -5,7 +5,7 @@
 pub struct Foo(u32);
 
 // ICE trigger, bad handling of differing types between rust and external ABIs
-pub extern fn bar() -> Foo {
+pub extern "C" fn bar() -> Foo {
     Foo(0)
 }
 
diff --git a/src/test/ui/extern/extern-wrong-value-type.rs b/src/test/ui/extern/extern-wrong-value-type.rs
index a4d7b00b1c6..337865ec18d 100644
--- a/src/test/ui/extern/extern-wrong-value-type.rs
+++ b/src/test/ui/extern/extern-wrong-value-type.rs
@@ -1,4 +1,4 @@
-extern fn f() {
+extern "C" fn f() {
 }
 
 fn is_fn<F>(_: F) where F: Fn() {}
diff --git a/src/test/ui/extern/issue-10025.rs b/src/test/ui/extern/issue-10025.rs
index 193d7ee891f..4439b468525 100644
--- a/src/test/ui/extern/issue-10025.rs
+++ b/src/test/ui/extern/issue-10025.rs
@@ -1,6 +1,6 @@
 // run-pass
-#![allow(dead_code)]
 // pretty-expanded FIXME #23616
+#![allow(dead_code)]
 
 unsafe extern fn foo() {}
 unsafe extern "C" fn bar() {}
diff --git a/src/test/ui/functions-closures/auxiliary/fn-abi.rs b/src/test/ui/functions-closures/auxiliary/fn-abi.rs
index 25c9e1b4ca3..ace9fbdfd0c 100644
--- a/src/test/ui/functions-closures/auxiliary/fn-abi.rs
+++ b/src/test/ui/functions-closures/auxiliary/fn-abi.rs
@@ -1,2 +1,2 @@
 #[no_mangle]
-pub extern fn foo() {}
+pub extern "C" fn foo() {}
diff --git a/src/test/ui/generics/generic-no-mangle.fixed b/src/test/ui/generics/generic-no-mangle.fixed
index 72f9af0124c..207d8a91b00 100644
--- a/src/test/ui/generics/generic-no-mangle.fixed
+++ b/src/test/ui/generics/generic-no-mangle.fixed
@@ -6,7 +6,7 @@
 pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
 
 
-pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
+pub extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
 
 #[no_mangle]
 pub fn baz(x: &i32) -> &i32 { x }
diff --git a/src/test/ui/generics/generic-no-mangle.rs b/src/test/ui/generics/generic-no-mangle.rs
index 08d631e6eee..146896cdc3d 100644
--- a/src/test/ui/generics/generic-no-mangle.rs
+++ b/src/test/ui/generics/generic-no-mangle.rs
@@ -6,7 +6,7 @@
 pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
 
 #[no_mangle]
-pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
+pub extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
 
 #[no_mangle]
 pub fn baz(x: &i32) -> &i32 { x }
diff --git a/src/test/ui/generics/generic-no-mangle.stderr b/src/test/ui/generics/generic-no-mangle.stderr
index e8e6d9d502d..b437417c0b1 100644
--- a/src/test/ui/generics/generic-no-mangle.stderr
+++ b/src/test/ui/generics/generic-no-mangle.stderr
@@ -17,8 +17,8 @@ error: functions generic over types or consts must be mangled
    |
 LL | #[no_mangle]
    | ------------ help: remove this attribute
-LL | pub extern fn bar<T>() {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | pub extern "C" fn bar<T>() {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/hashmap/hashmap-memory.rs b/src/test/ui/hashmap/hashmap-memory.rs
index 3129eb0da82..2031196ab21 100644
--- a/src/test/ui/hashmap/hashmap-memory.rs
+++ b/src/test/ui/hashmap/hashmap-memory.rs
@@ -23,7 +23,7 @@ mod map_reduce {
 
     pub type putter<'a> = Box<dyn FnMut(String, String) + 'a>;
 
-    pub type mapper = extern fn(String, putter);
+    pub type mapper = extern "C" fn(String, putter);
 
     enum ctrl_proto { find_reducer(Vec<u8>, Sender<isize>), mapper_done, }
 
diff --git a/src/test/ui/issues/auxiliary/issue-13620-1.rs b/src/test/ui/issues/auxiliary/issue-13620-1.rs
index 1442c0cc7aa..a77aa5a7155 100644
--- a/src/test/ui/issues/auxiliary/issue-13620-1.rs
+++ b/src/test/ui/issues/auxiliary/issue-13620-1.rs
@@ -1,8 +1,8 @@
 pub struct Foo {
-    pub foo: extern fn()
+    pub foo: extern "C" fn()
 }
 
-extern fn the_foo() {}
+extern "C" fn the_foo() {}
 
 pub const FOO: Foo = Foo {
     foo: the_foo
diff --git a/src/test/ui/issues/issue-10764.rs b/src/test/ui/issues/issue-10764.rs
index 8fa3607815a..bb915f58d9d 100644
--- a/src/test/ui/issues/issue-10764.rs
+++ b/src/test/ui/issues/issue-10764.rs
@@ -1,5 +1,5 @@
 fn f(_: extern "Rust" fn()) {}
-extern fn bar() {}
+extern "C" fn bar() {}
 
 fn main() { f(bar) }
 //~^ ERROR mismatched types
diff --git a/src/test/ui/issues/issue-15562.rs b/src/test/ui/issues/issue-15562.rs
index b37ba81e291..dc0ecd36522 100644
--- a/src/test/ui/issues/issue-15562.rs
+++ b/src/test/ui/issues/issue-15562.rs
@@ -16,4 +16,4 @@ pub fn main() {
 // The above extern is NOT `extern "rust-intrinsic"` and thus
 // means it'll try to find a corresponding symbol to link to.
 #[no_mangle]
-pub extern fn transmute() {}
+pub extern "C" fn transmute() {}
diff --git a/src/test/ui/issues/issue-26997.rs b/src/test/ui/issues/issue-26997.rs
index fcabd1d8455..3653e62732d 100644
--- a/src/test/ui/issues/issue-26997.rs
+++ b/src/test/ui/issues/issue-26997.rs
@@ -7,7 +7,7 @@ pub struct Foo {
 
 impl Foo {
     #[allow(improper_ctypes_definitions)]
-    pub extern fn foo_new() -> Foo {
+    pub extern "C" fn foo_new() -> Foo {
         Foo { x: 21, y: 33 }
     }
 }
diff --git a/src/test/ui/issues/issue-28600.rs b/src/test/ui/issues/issue-28600.rs
index 297519b9a79..52db0d5fd84 100644
--- a/src/test/ui/issues/issue-28600.rs
+++ b/src/test/ui/issues/issue-28600.rs
@@ -7,7 +7,7 @@ impl Test {
     #[allow(dead_code)]
     #[allow(unused_variables)]
     #[allow(improper_ctypes_definitions)]
-    pub extern fn test(val: &str) {
+    pub extern "C" fn test(val: &str) {
 
     }
 }
diff --git a/src/test/ui/issues/issue-51907.rs b/src/test/ui/issues/issue-51907.rs
index 52d26d0954a..9378f435713 100644
--- a/src/test/ui/issues/issue-51907.rs
+++ b/src/test/ui/issues/issue-51907.rs
@@ -1,15 +1,15 @@
 // run-pass
 trait Foo {
-    extern fn borrow(&self);
-    extern fn take(self: Box<Self>);
+    extern "C" fn borrow(&self);
+    extern "C" fn take(self: Box<Self>);
 }
 
 struct Bar;
 impl Foo for Bar {
     #[allow(improper_ctypes_definitions)]
-    extern fn borrow(&self) {}
+    extern "C" fn borrow(&self) {}
     #[allow(improper_ctypes_definitions)]
-    extern fn take(self: Box<Self>) {}
+    extern "C" fn take(self: Box<Self>) {}
 }
 
 fn main() {
diff --git a/src/test/ui/lint/lint-ctypes-fn.rs b/src/test/ui/lint/lint-ctypes-fn.rs
index 170a04efb07..e69d0dab496 100644
--- a/src/test/ui/lint/lint-ctypes-fn.rs
+++ b/src/test/ui/lint/lint-ctypes-fn.rs
@@ -27,7 +27,7 @@ pub struct ZeroSize;
 
 pub type RustFn = fn();
 
-pub type RustBadRet = extern fn() -> Box<u32>;
+pub type RustBadRet = extern "C" fn() -> Box<u32>;
 
 pub type CVoidRet = ();
 
@@ -116,7 +116,7 @@ pub extern "C" fn transparent_str(p: TransparentStr) { }
 
 pub extern "C" fn transparent_fn(p: TransparentBadFn) { }
 
-pub extern "C" fn good3(fptr: Option<extern fn()>) { }
+pub extern "C" fn good3(fptr: Option<extern "C" fn()>) { }
 
 pub extern "C" fn good4(aptr: &[u8; 4 as usize]) { }
 
@@ -124,9 +124,9 @@ pub extern "C" fn good5(s: StructWithProjection) { }
 
 pub extern "C" fn good6(s: StructWithProjectionAndLifetime) { }
 
-pub extern "C" fn good7(fptr: extern fn() -> ()) { }
+pub extern "C" fn good7(fptr: extern "C" fn() -> ()) { }
 
-pub extern "C" fn good8(fptr: extern fn() -> !) { }
+pub extern "C" fn good8(fptr: extern "C" fn() -> !) { }
 
 pub extern "C" fn good9() -> () { }
 
diff --git a/src/test/ui/mir/mir_codegen_calls.rs b/src/test/ui/mir/mir_codegen_calls.rs
index d93a25c8ef4..6a5a4dace64 100644
--- a/src/test/ui/mir/mir_codegen_calls.rs
+++ b/src/test/ui/mir/mir_codegen_calls.rs
@@ -75,7 +75,7 @@ fn test8() -> isize {
 }
 
 #[allow(improper_ctypes_definitions)]
-extern fn simple_extern(x: u32, y: (u32, u32)) -> u32 {
+extern "C" fn simple_extern(x: u32, y: (u32, u32)) -> u32 {
     x + y.0 * y.1
 }
 
diff --git a/src/test/ui/no_owned_box_lang_item.rs b/src/test/ui/no_owned_box_lang_item.rs
index bef630d826c..c22b44ffca2 100644
--- a/src/test/ui/no_owned_box_lang_item.rs
+++ b/src/test/ui/no_owned_box_lang_item.rs
@@ -11,6 +11,6 @@ fn main() {
     let x = box 1i32;
 }
 
-#[lang = "eh_personality"] extern fn eh_personality() {}
+#[lang = "eh_personality"] extern "C" fn eh_personality() {}
 #[lang = "eh_catch_typeinfo"] static EH_CATCH_TYPEINFO: u8 = 0;
 #[lang = "panic_impl"] fn panic_impl(panic: &PanicInfo) -> ! { loop {} }
diff --git a/src/test/ui/nullable-pointer-size.rs b/src/test/ui/nullable-pointer-size.rs
index 63a106f1292..0384553b699 100644
--- a/src/test/ui/nullable-pointer-size.rs
+++ b/src/test/ui/nullable-pointer-size.rs
@@ -31,5 +31,5 @@ macro_rules! check_type {
 pub fn main() {
     check_type!(&'static isize);
     check_type!(Box<isize>);
-    check_type!(extern fn());
+    check_type!(extern "C" fn());
 }
diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs
index 433301fb434..c92015eeebc 100644
--- a/src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs
+++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs
@@ -8,10 +8,10 @@
 #![panic_runtime]
 
 #[no_mangle]
-pub extern fn __rust_maybe_catch_panic() {}
+pub extern "C" fn __rust_maybe_catch_panic() {}
 
 #[no_mangle]
-pub extern fn __rust_start_panic() {}
+pub extern "C" fn __rust_start_panic() {}
 
 #[no_mangle]
-pub extern fn rust_eh_personality() {}
+pub extern "C" fn rust_eh_personality() {}
diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs
index 97452a342ab..2f7aed9248a 100644
--- a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs
+++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs
@@ -8,10 +8,10 @@
 #![panic_runtime]
 
 #[no_mangle]
-pub extern fn __rust_maybe_catch_panic() {}
+pub extern "C" fn __rust_maybe_catch_panic() {}
 
 #[no_mangle]
-pub extern fn __rust_start_panic() {}
+pub extern "C" fn __rust_start_panic() {}
 
 #[no_mangle]
-pub extern fn rust_eh_personality() {}
+pub extern "C" fn rust_eh_personality() {}
diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs
index 97452a342ab..2f7aed9248a 100644
--- a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs
+++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs
@@ -8,10 +8,10 @@
 #![panic_runtime]
 
 #[no_mangle]
-pub extern fn __rust_maybe_catch_panic() {}
+pub extern "C" fn __rust_maybe_catch_panic() {}
 
 #[no_mangle]
-pub extern fn __rust_start_panic() {}
+pub extern "C" fn __rust_start_panic() {}
 
 #[no_mangle]
-pub extern fn rust_eh_personality() {}
+pub extern "C" fn rust_eh_personality() {}
diff --git a/src/test/ui/parser/bad-lit-suffixes.stderr b/src/test/ui/parser/bad-lit-suffixes.stderr
index 8c433961408..9b596571481 100644
--- a/src/test/ui/parser/bad-lit-suffixes.stderr
+++ b/src/test/ui/parser/bad-lit-suffixes.stderr
@@ -110,16 +110,5 @@ LL |     1.0e10suffix;
    |
    = help: valid suffixes are `f32` and `f64`
 
-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
+error: aborting due to 16 previous errors
 
diff --git a/src/test/ui/proc-macro/signature.rs b/src/test/ui/proc-macro/signature.rs
index dbc1577172f..e08928716b0 100644
--- a/src/test/ui/proc-macro/signature.rs
+++ b/src/test/ui/proc-macro/signature.rs
@@ -7,7 +7,7 @@
 extern crate proc_macro;
 
 #[proc_macro_derive(A)]
-pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
+pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
     //~^ ERROR: mismatched types
     loop {}
 }
diff --git a/src/test/ui/proc-macro/signature.stderr b/src/test/ui/proc-macro/signature.stderr
index 6ebc99601c4..80a459c4125 100644
--- a/src/test/ui/proc-macro/signature.stderr
+++ b/src/test/ui/proc-macro/signature.stderr
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/signature.rs:10:1
    |
-LL | / pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
+LL | / pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
 LL | |
 LL | |     loop {}
 LL | | }
diff --git a/src/test/ui/proc-macro/span-preservation.rs b/src/test/ui/proc-macro/span-preservation.rs
index b22e50c4c17..0c735865558 100644
--- a/src/test/ui/proc-macro/span-preservation.rs
+++ b/src/test/ui/proc-macro/span-preservation.rs
@@ -35,7 +35,7 @@ fn c() {
 }
 
 #[recollect_attr]
-extern fn bar() {
+extern "C" fn bar() {
     0 //~ ERROR mismatched types
 }
 
diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr
index 4064c5b3819..9e91ed4068b 100644
--- a/src/test/ui/proc-macro/span-preservation.stderr
+++ b/src/test/ui/proc-macro/span-preservation.stderr
@@ -37,8 +37,8 @@ LL |     let y = Foo { a: 10, b: 10isize };
 error[E0308]: mismatched types
   --> $DIR/span-preservation.rs:39:5
    |
-LL | extern fn bar() {
-   |                 - possibly return type missing here?
+LL | extern "C" fn bar() {
+   |                     - possibly return type missing here?
 LL |     0
    |     ^ expected `()`, found integer
 
diff --git a/src/test/ui/range/issue-54505-no-std.rs b/src/test/ui/range/issue-54505-no-std.rs
index f5d5823e468..ab1a025b521 100644
--- a/src/test/ui/range/issue-54505-no-std.rs
+++ b/src/test/ui/range/issue-54505-no-std.rs
@@ -13,7 +13,7 @@ use core::ops::RangeBounds;
 
 #[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))]
 #[lang = "eh_personality"]
-extern fn eh_personality() {}
+extern "C" fn eh_personality() {}
 #[cfg(target_os = "emscripten")]
 #[lang = "eh_catch_typeinfo"]
 static EH_CATCH_TYPEINFO: u8 = 0;
diff --git a/src/test/ui/signal-alternate-stack-cleanup.rs b/src/test/ui/signal-alternate-stack-cleanup.rs
index 15fcf78893e..8a6d738959e 100644
--- a/src/test/ui/signal-alternate-stack-cleanup.rs
+++ b/src/test/ui/signal-alternate-stack-cleanup.rs
@@ -13,11 +13,11 @@ extern crate libc;
 
 use libc::*;
 
-unsafe extern fn signal_handler(signum: c_int, _: *mut siginfo_t, _: *mut c_void) {
+unsafe extern "C" fn signal_handler(signum: c_int, _: *mut siginfo_t, _: *mut c_void) {
     assert_eq!(signum, SIGWINCH);
 }
 
-extern fn send_signal() {
+extern "C" fn send_signal() {
     unsafe {
         raise(SIGWINCH);
     }
diff --git a/src/test/ui/structs-enums/class-dtor.rs b/src/test/ui/structs-enums/class-dtor.rs
index ee1cac03c81..583a5e24098 100644
--- a/src/test/ui/structs-enums/class-dtor.rs
+++ b/src/test/ui/structs-enums/class-dtor.rs
@@ -5,7 +5,7 @@
 // pretty-expanded FIXME #23616
 
 struct cat {
-  done : extern fn(usize),
+  done : extern "C" fn(usize),
   meows : usize,
 }
 
@@ -15,7 +15,7 @@ impl Drop for cat {
     }
 }
 
-fn cat(done: extern fn(usize)) -> cat {
+fn cat(done: extern "C" fn(usize)) -> cat {
     cat {
         meows: 0,
         done: done
diff --git a/src/test/ui/symbol-names/impl1.rs b/src/test/ui/symbol-names/impl1.rs
index 05bd98df006..24bdf6d669e 100644
--- a/src/test/ui/symbol-names/impl1.rs
+++ b/src/test/ui/symbol-names/impl1.rs
@@ -60,7 +60,7 @@ fn main() {
         }
 
         // Test type mangling, by putting them in an `impl` header.
-        impl Bar for [&'_ (dyn Foo<Assoc = extern fn(&u8, ...)> + AutoTrait); 3] {
+        impl Bar for [&'_ (dyn Foo<Assoc = extern "C" fn(&u8, ...)> + AutoTrait); 3] {
             #[rustc_symbol_name]
             //[legacy]~^ ERROR symbol-name(_ZN209_$LT$$u5b$$RF$dyn$u20$impl1..Foo$u2b$Assoc$u20$$u3d$$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RF$u8$C$$u20$...$RP$$u2b$impl1..AutoTrait$u3b$$u20$3$u5d$$u20$as$u20$impl1..main..$u7b$$u7b$closure$u7d$$u7d$..Bar$GT$6method
             //[legacy]~| ERROR demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method
diff --git a/src/test/ui/type-param.rs b/src/test/ui/type-param.rs
index f5ac19cf73a..ca2f24d379b 100644
--- a/src/test/ui/type-param.rs
+++ b/src/test/ui/type-param.rs
@@ -6,6 +6,6 @@
 
 // pretty-expanded FIXME #23616
 
-type lteq<T> = extern fn(T) -> bool;
+type lteq<T> = extern "C" fn(T) -> bool;
 
 pub fn main() { }
diff --git a/src/test/ui/type-params-in-for-each.rs b/src/test/ui/type-params-in-for-each.rs
index be4a0185eda..53475d28047 100644
--- a/src/test/ui/type-params-in-for-each.rs
+++ b/src/test/ui/type-params-in-for-each.rs
@@ -14,7 +14,7 @@ fn range_<F>(lo: usize, hi: usize, mut it: F) where F: FnMut(usize) {
     while lo_ < hi { it(lo_); lo_ += 1; }
 }
 
-fn create_index<T>(_index: Vec<S<T>> , _hash_fn: extern fn(T) -> usize) {
+fn create_index<T>(_index: Vec<S<T>> , _hash_fn: extern "C" fn(T) -> usize) {
     range_(0, 256, |_i| {
         let _bucket: Vec<T> = Vec::new();
     })
diff --git a/src/test/ui/unique/unique-ffi-symbols.rs b/src/test/ui/unique/unique-ffi-symbols.rs
index b0fe22bc332..77b5ead2633 100644
--- a/src/test/ui/unique/unique-ffi-symbols.rs
+++ b/src/test/ui/unique/unique-ffi-symbols.rs
@@ -3,12 +3,12 @@
 // whenever the item path wasn't enough to disambiguate between them.
 fn main() {
     let a = {
-        extern fn good() -> i32 { return 0; }
-        good as extern fn() -> i32
+        extern "C" fn good() -> i32 { return 0; }
+        good as extern "C" fn() -> i32
     };
     let b = {
-        extern fn good() -> i32 { return 5; }
-        good as extern fn() -> i32
+        extern "C" fn good() -> i32 { return 5; }
+        good as extern "C" fn() -> i32
     };
 
     assert!(a != b);