Follow the diagnostic output style guide
This commit is contained in:
parent
b27661eb33
commit
fb0b1a5466
8 changed files with 14 additions and 14 deletions
|
@ -102,7 +102,7 @@ impl NonConstOp for FnCallUnstable {
|
||||||
);
|
);
|
||||||
|
|
||||||
if ccx.is_const_stable_const_fn() {
|
if ccx.is_const_stable_const_fn() {
|
||||||
err.help("Const-stable functions can only call other const-stable functions");
|
err.help("const-stable functions can only call other const-stable functions");
|
||||||
} else if ccx.tcx.sess.is_nightly_build() {
|
} else if ccx.tcx.sess.is_nightly_build() {
|
||||||
if let Some(feature) = feature {
|
if let Some(feature) = feature {
|
||||||
err.help(&format!(
|
err.help(&format!(
|
||||||
|
|
|
@ -58,7 +58,7 @@ pub(super) fn check_abi(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: Ab
|
||||||
tcx.sess,
|
tcx.sess,
|
||||||
span,
|
span,
|
||||||
E0781,
|
E0781,
|
||||||
"the `\"C-cmse-nonsecure-call\"` ABI is only allowed on function pointers."
|
"the `\"C-cmse-nonsecure-call\"` ABI is only allowed on function pointers"
|
||||||
)
|
)
|
||||||
.emit()
|
.emit()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error[E0781]: the `"C-cmse-nonsecure-call"` ABI is only allowed on function pointers.
|
error[E0781]: the `"C-cmse-nonsecure-call"` ABI is only allowed on function pointers
|
||||||
--> $DIR/wrong-abi-location-1.rs:8:1
|
--> $DIR/wrong-abi-location-1.rs:8:1
|
||||||
|
|
|
|
||||||
LL | pub extern "C-cmse-nonsecure-call" fn test() {}
|
LL | pub extern "C-cmse-nonsecure-call" fn test() {}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error[E0781]: the `"C-cmse-nonsecure-call"` ABI is only allowed on function pointers.
|
error[E0781]: the `"C-cmse-nonsecure-call"` ABI is only allowed on function pointers
|
||||||
--> $DIR/wrong-abi-location-2.rs:8:1
|
--> $DIR/wrong-abi-location-2.rs:8:1
|
||||||
|
|
|
|
||||||
LL | / extern "C-cmse-nonsecure-call" {
|
LL | / extern "C-cmse-nonsecure-call" {
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: `foo` is not yet stable as a const fn
|
||||||
LL | const fn bar() -> u32 { foo() }
|
LL | const fn bar() -> u32 { foo() }
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: `foo2` is not yet stable as a const fn
|
error: `foo2` is not yet stable as a const fn
|
||||||
--> $DIR/min_const_fn_libstd_stability.rs:24:26
|
--> $DIR/min_const_fn_libstd_stability.rs:24:26
|
||||||
|
@ -12,7 +12,7 @@ error: `foo2` is not yet stable as a const fn
|
||||||
LL | const fn bar2() -> u32 { foo2() }
|
LL | const fn bar2() -> u32 { foo2() }
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
|
error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
|
||||||
--> $DIR/min_const_fn_libstd_stability.rs:29:26
|
--> $DIR/min_const_fn_libstd_stability.rs:29:26
|
||||||
|
@ -35,7 +35,7 @@ error: `foo2_gated` is not yet stable as a const fn
|
||||||
LL | const fn bar2_gated() -> u32 { foo2_gated() }
|
LL | const fn bar2_gated() -> u32 { foo2_gated() }
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: `foo` is not yet stable as a const fn
|
||||||
LL | const unsafe fn bar() -> u32 { unsafe { foo() } }
|
LL | const unsafe fn bar() -> u32 { unsafe { foo() } }
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: `foo2` is not yet stable as a const fn
|
error: `foo2` is not yet stable as a const fn
|
||||||
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:24:42
|
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:24:42
|
||||||
|
@ -12,7 +12,7 @@ error: `foo2` is not yet stable as a const fn
|
||||||
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
|
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
|
error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
|
||||||
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:29:33
|
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:29:33
|
||||||
|
@ -35,7 +35,7 @@ error: `foo2_gated` is not yet stable as a const fn
|
||||||
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
|
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: `foo` is not yet stable as a const fn
|
||||||
LL | const unsafe fn bar() -> u32 { foo() }
|
LL | const unsafe fn bar() -> u32 { foo() }
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: `foo2` is not yet stable as a const fn
|
error: `foo2` is not yet stable as a const fn
|
||||||
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:24:33
|
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:24:33
|
||||||
|
@ -12,7 +12,7 @@ error: `foo2` is not yet stable as a const fn
|
||||||
LL | const unsafe fn bar2() -> u32 { foo2() }
|
LL | const unsafe fn bar2() -> u32 { foo2() }
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: `foo2_gated` is not yet stable as a const fn
|
error: `foo2_gated` is not yet stable as a const fn
|
||||||
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:33:39
|
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:33:39
|
||||||
|
@ -20,7 +20,7 @@ error: `foo2_gated` is not yet stable as a const fn
|
||||||
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() }
|
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() }
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ error: `<Int as Add>::add` is not yet stable as a const fn
|
||||||
LL | Int(1i32) + Int(2i32)
|
LL | Int(1i32) + Int(2i32)
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: Const-stable functions can only call other const-stable functions
|
= help: const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue