Add code to invalid ABI
error
This commit is contained in:
parent
6ec1b626ba
commit
09e42bcb10
3 changed files with 14 additions and 7 deletions
|
@ -397,4 +397,5 @@ register_diagnostics! {
|
||||||
E0630, // rustc_const_unstable attribute must be paired with stable/unstable attribute
|
E0630, // rustc_const_unstable attribute must be paired with stable/unstable attribute
|
||||||
E0693, // incorrect `repr(align)` attribute format
|
E0693, // incorrect `repr(align)` attribute format
|
||||||
E0694, // an unknown tool name found in scoped attributes
|
E0694, // an unknown tool name found in scoped attributes
|
||||||
|
E0697, // invalid ABI
|
||||||
}
|
}
|
||||||
|
|
|
@ -6535,12 +6535,15 @@ impl<'a> Parser<'a> {
|
||||||
Some(abi) => Ok(Some(abi)),
|
Some(abi) => Ok(Some(abi)),
|
||||||
None => {
|
None => {
|
||||||
let prev_span = self.prev_span;
|
let prev_span = self.prev_span;
|
||||||
self.span_err(
|
let mut err = struct_span_err!(
|
||||||
|
self.sess.span_diagnostic,
|
||||||
prev_span,
|
prev_span,
|
||||||
&format!("invalid ABI: expected one of [{}], \
|
E0697,
|
||||||
found `{}`",
|
"invalid ABI: found `{}`",
|
||||||
abi::all_names().join(", "),
|
s);
|
||||||
s));
|
err.span_label(prev_span, "invalid ABI");
|
||||||
|
err.help(&format!("valid ABIs: {}", abi::all_names().join(", ")));
|
||||||
|
err.emit();
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted], found `路濫狼á́́`
|
error[E0697]: invalid ABI: found `路濫狼á́́`
|
||||||
--> $DIR/unicode.rs:11:8
|
--> $DIR/unicode.rs:11:8
|
||||||
|
|
|
|
||||||
LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
|
LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^ invalid ABI
|
||||||
|
|
|
||||||
|
= help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0697`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue