Skip to content

Commit bf149c0

Browse files
committed
Use the term foreign function in errors
1 parent d8344ff commit bf149c0

11 files changed

+18
-18
lines changed

src/librustc_typeck/collect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
22792279
tcx.sess,
22802280
attr.span,
22812281
E0724,
2282-
"`#[ffi_pure]` may only be used on `extern fn`s"
2282+
"`#[ffi_pure]` may only be used on foreign functions"
22832283
).emit();
22842284
}
22852285
} else if attr.check_name("ffi_const") {
@@ -2291,7 +2291,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
22912291
tcx.sess,
22922292
attr.span,
22932293
E0725,
2294-
"`#[ffi_const]` may only be used on `extern fn`s"
2294+
"`#[ffi_const]` may only be used on foreign functions"
22952295
).emit();
22962296
}
22972297
} else if attr.check_name("rustc_allocator_nounwind") {

src/librustc_typeck/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4720,6 +4720,6 @@ register_diagnostics! {
47204720
E0698, // type inside generator must be known in this context
47214721
E0719, // duplicate values for associated type binding
47224722
E0722, // Malformed #[optimize] attribute
4723-
E0724, // `#[ffi_pure]` is only allowed `extern fn`s
4724-
E0725, // `#[ffi_const]` is only allowed `extern fn`s
4723+
E0724, // `#[ffi_pure]` is only allowed on foreign fn
4724+
E0725, // `#[ffi_const]` is only allowed on foreign fn
47254725
}

src/libsyntax/feature_gate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ declare_features! (
290290
// The `repr(i128)` annotation for enums.
291291
(active, repr128, "1.16.0", Some(35118), None),
292292

293-
// Allows the use of `#[ffi_pure]` on extern functions.
293+
// Allows the use of `#[ffi_pure]` on foreign functions.
294294
(active, ffi_pure, "1.34.0", Some(58329), None),
295295

296-
// Allows the use of `#[ffi_const]` on extern functions.
296+
// Allows the use of `#[ffi_const]` on foreign functions.
297297
(active, ffi_const, "1.34.0", Some(58328), None),
298298

299299
// The `unadjusted` ABI; perma-unstable.

src/test/ui/feature-gates/feature-gate-ffi_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#![crate_type = "lib"]
33

44
extern {
5-
#[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58314)
5+
#[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58328)
66
pub fn foo();
77
}

src/test/ui/feature-gates/feature-gate-ffi_const.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0658]: the `#[ffi_const]` attribute is an experimental feature (see issue #58314)
1+
error[E0658]: the `#[ffi_const]` attribute is an experimental feature (see issue #58328)
22
--> $DIR/feature-gate-ffi_const.rs:5:5
33
|
4-
LL | #[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58314)
4+
LL | #[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58328)
55
| ^^^^^^^^^^^^
66
|
77
= help: add #![feature(ffi_const)] to the crate attributes to enable

src/test/ui/feature-gates/feature-gate-ffi_pure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#![crate_type = "lib"]
33

44
extern {
5-
#[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58314)
5+
#[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58329)
66
pub fn foo();
77
}

src/test/ui/feature-gates/feature-gate-ffi_pure.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0658]: the `#[ffi_pure]` attribute is an experimental feature (see issue #58314)
1+
error[E0658]: the `#[ffi_pure]` attribute is an experimental feature (see issue #58329)
22
--> $DIR/feature-gate-ffi_pure.rs:5:5
33
|
4-
LL | #[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58314)
4+
LL | #[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58329)
55
| ^^^^^^^^^^^
66
|
77
= help: add #![feature(ffi_pure)] to the crate attributes to enable

src/test/ui/ffi_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
#![feature(ffi_const)]
33
#![crate_type = "lib"]
44

5-
#[ffi_const] //~ ERROR `#[ffi_const]` may only be used on `extern fn`s [E0725]
5+
#[ffi_const] //~ ERROR `#[ffi_const]` may only be used on foreign functions [E0725]
66
pub fn foo() {}

src/test/ui/ffi_const.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0725]: `#[ffi_const]` may only be used on `extern fn`s
1+
error[E0725]: `#[ffi_const]` may only be used on foreign functions
22
--> $DIR/ffi_const.rs:5:1
33
|
4-
LL | #[ffi_const] //~ ERROR `#[ffi_const]` may only be used on `extern fn`s [E0725]
4+
LL | #[ffi_const] //~ ERROR `#[ffi_const]` may only be used on foreign functions [E0725]
55
| ^^^^^^^^^^^^
66

77
error: aborting due to previous error

src/test/ui/ffi_pure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
#![feature(ffi_pure)]
33
#![crate_type = "lib"]
44

5-
#[ffi_pure] //~ ERROR `#[ffi_pure]` may only be used on `extern fn`s [E0724]
5+
#[ffi_pure] //~ ERROR `#[ffi_pure]` may only be used on foreign functions [E0724]
66
pub fn foo() {}

src/test/ui/ffi_pure.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0724]: `#[ffi_pure]` may only be used on `extern fn`s
1+
error[E0724]: `#[ffi_pure]` may only be used on foreign functions
22
--> $DIR/ffi_pure.rs:5:1
33
|
4-
LL | #[ffi_pure] //~ ERROR `#[ffi_pure]` may only be used on `extern fn`s [E0724]
4+
LL | #[ffi_pure] //~ ERROR `#[ffi_pure]` may only be used on foreign functions [E0724]
55
| ^^^^^^^^^^^
66

77
error: aborting due to previous error

0 commit comments

Comments
 (0)