Skip to content

Commit

Permalink
Correct error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Feb 23, 2019
1 parent c4b46ac commit 52ba07d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/librustc_typeck/collect.rs
Expand Up @@ -2397,7 +2397,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
tcx.sess,
attr.span,
E0723,
"`#[ffi_returns_twice]` may only be used on `extern fn`s"
"`#[ffi_returns_twice]` may only be used on foreign functions"
).emit();
}
} else if attr.check_name("rustc_allocator_nounwind") {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/diagnostics.rs
Expand Up @@ -4738,5 +4738,5 @@ register_diagnostics! {
E0698, // type inside generator must be known in this context
E0719, // duplicate values for associated type binding
E0722, // Malformed #[optimize] attribute
E0723, // `#[ffi_returns_twice]` is only allowed in `extern fn`
E0723, // `#[ffi_returns_twice]` is only allowed in foreign functions
}
2 changes: 1 addition & 1 deletion src/libsyntax/feature_gate.rs
Expand Up @@ -290,7 +290,7 @@ declare_features! (
// The `repr(i128)` annotation for enums.
(active, repr128, "1.16.0", Some(35118), None),

// Allows the use of `#[ffi_returns_twice]` on extern functions.
// Allows the use of `#[ffi_returns_twice]` on foreign functions.
(active, ffi_returns_twice, "1.34.0", Some(58314), None),

// The `unadjusted` ABI; perma-unstable.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/ffi_returns_twice.rs
Expand Up @@ -2,5 +2,5 @@
#![feature(ffi_returns_twice)]
#![crate_type = "lib"]

#[ffi_returns_twice] //~ ERROR `#[ffi_returns_twice]` may only be used on `extern fn`s
#[ffi_returns_twice] //~ ERROR `#[ffi_returns_twice]` may only be used on foreign functions
pub fn foo() {}
4 changes: 2 additions & 2 deletions src/test/ui/ffi_returns_twice.stderr
@@ -1,7 +1,7 @@
error[E0723]: `#[ffi_returns_twice]` may only be used on `extern fn`s
error[E0723]: `#[ffi_returns_twice]` may only be used on foreign functions
--> $DIR/ffi_returns_twice.rs:5:1
|
LL | #[ffi_returns_twice] //~ ERROR `#[ffi_returns_twice]` may only be used on `extern fn`s
LL | #[ffi_returns_twice] //~ ERROR `#[ffi_returns_twice]` may only be used on foreign functions
| ^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
Expand Down

0 comments on commit 52ba07d

Please sign in to comment.