Skip to content

Commit 52ba07d

Browse files
committed
Correct error message
1 parent c4b46ac commit 52ba07d

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
@@ -2397,7 +2397,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
23972397
tcx.sess,
23982398
attr.span,
23992399
E0723,
2400-
"`#[ffi_returns_twice]` may only be used on `extern fn`s"
2400+
"`#[ffi_returns_twice]` may only be used on foreign functions"
24012401
).emit();
24022402
}
24032403
} else if attr.check_name("rustc_allocator_nounwind") {

src/librustc_typeck/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4738,5 +4738,5 @@ register_diagnostics! {
47384738
E0698, // type inside generator must be known in this context
47394739
E0719, // duplicate values for associated type binding
47404740
E0722, // Malformed #[optimize] attribute
4741-
E0723, // `#[ffi_returns_twice]` is only allowed in `extern fn`
4741+
E0723, // `#[ffi_returns_twice]` is only allowed in foreign functions
47424742
}

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)