Skip to content

Commit 19ee98f

Browse files
committed
Correct error message
1 parent bc9bfc7 commit 19ee98f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/librustc_typeck/collect.rs

+1-1
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
E0723,
2282-
"`#[ffi_returns_twice]` may only be used on `extern fn`s"
2282+
"`#[ffi_returns_twice]` may only be used on foreign functions"
22832283
).emit();
22842284
}
22852285
} else if attr.check_name("rustc_allocator_nounwind") {

src/librustc_typeck/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4720,5 +4720,5 @@ 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-
E0723, // `#[ffi_returns_twice]` is only allowed in `extern fn`
4723+
E0723, // `#[ffi_returns_twice]` is only allowed in foreign functions
47244724
}

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ 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_returns_twice]` on extern functions.
293+
// Allows the use of `#[ffi_returns_twice]` on foreign functions.
294294
(active, ffi_returns_twice, "1.34.0", Some(58314), None),
295295

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

src/test/ui/ffi_returns_twice.rs

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

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

src/test/ui/ffi_returns_twice.stderr

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

77
error: aborting due to previous error

0 commit comments

Comments
 (0)