提交 52ba07db 编写于 作者: G gnzlbg

Correct error message

上级 c4b46ace
......@@ -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") {
......
......@@ -4738,5 +4738,5 @@ fn make_recursive_type() -> impl Sized {
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
}
......@@ -290,7 +290,7 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
// 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.
......
......@@ -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() {}
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册