Skip to content

Commit

Permalink
Use the term foreign function in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Feb 9, 2019
1 parent d8344ff commit bf149c0
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
tcx.sess,
attr.span,
E0724,
"`#[ffi_pure]` may only be used on `extern fn`s"
"`#[ffi_pure]` may only be used on foreign functions"
).emit();
}
} else if attr.check_name("ffi_const") {
Expand All @@ -2291,7 +2291,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
tcx.sess,
attr.span,
E0725,
"`#[ffi_const]` may only be used on `extern fn`s"
"`#[ffi_const]` may only be used on foreign functions"
).emit();
}
} else if attr.check_name("rustc_allocator_nounwind") {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4720,6 +4720,6 @@ register_diagnostics! {
E0698, // type inside generator must be known in this context
E0719, // duplicate values for associated type binding
E0722, // Malformed #[optimize] attribute
E0724, // `#[ffi_pure]` is only allowed `extern fn`s
E0725, // `#[ffi_const]` is only allowed `extern fn`s
E0724, // `#[ffi_pure]` is only allowed on foreign fn
E0725, // `#[ffi_const]` is only allowed on foreign fn
}
4 changes: 2 additions & 2 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ declare_features! (
// The `repr(i128)` annotation for enums.
(active, repr128, "1.16.0", Some(35118), None),

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

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

// The `unadjusted` ABI; perma-unstable.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-ffi_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#![crate_type = "lib"]

extern {
#[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58314)
#[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58328)
pub fn foo();
}
4 changes: 2 additions & 2 deletions src/test/ui/feature-gates/feature-gate-ffi_const.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0658]: the `#[ffi_const]` attribute is an experimental feature (see issue #58314)
error[E0658]: the `#[ffi_const]` attribute is an experimental feature (see issue #58328)
--> $DIR/feature-gate-ffi_const.rs:5:5
|
LL | #[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58314)
LL | #[ffi_const] //~ ERROR the `#[ffi_const]` attribute is an experimental feature (see issue #58328)
| ^^^^^^^^^^^^
|
= help: add #![feature(ffi_const)] to the crate attributes to enable
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-ffi_pure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#![crate_type = "lib"]

extern {
#[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58314)
#[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58329)
pub fn foo();
}
4 changes: 2 additions & 2 deletions src/test/ui/feature-gates/feature-gate-ffi_pure.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0658]: the `#[ffi_pure]` attribute is an experimental feature (see issue #58314)
error[E0658]: the `#[ffi_pure]` attribute is an experimental feature (see issue #58329)
--> $DIR/feature-gate-ffi_pure.rs:5:5
|
LL | #[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58314)
LL | #[ffi_pure] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature (see issue #58329)
| ^^^^^^^^^^^
|
= help: add #![feature(ffi_pure)] to the crate attributes to enable
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/ffi_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
#![feature(ffi_const)]
#![crate_type = "lib"]

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

error: aborting due to previous error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/ffi_pure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
#![feature(ffi_pure)]
#![crate_type = "lib"]

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

error: aborting due to previous error
Expand Down

0 comments on commit bf149c0

Please sign in to comment.