1
Fork 0

Rollup merge of #131675 - tdittr:update-unsupported-abi-message, r=compiler-errors

Update lint message for ABI not supported

Tracking issue: #130260

As requested in https://github.com/rust-lang/rust/pull/128784#pullrequestreview-2364026550 I updated the error message.

I could also change it to be the same message as if it was a hard error on a normal function:

> "`{abi}` is not a supported ABI for the current target"

Or would that get confusing when people try to google the error message?

r? compiler-errors
This commit is contained in:
Matthias Krüger 2024-10-15 05:11:38 +02:00 committed by GitHub
commit bd649b4dd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 57 additions and 57 deletions

View file

@ -61,9 +61,9 @@ pub fn check_abi_fn_ptr(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: Ab
Some(true) => (),
Some(false) | None => {
tcx.node_span_lint(UNSUPPORTED_FN_PTR_CALLING_CONVENTIONS, hir_id, span, |lint| {
lint.primary_message(
"use of calling convention not supported on this target on function pointer",
);
lint.primary_message(format!(
"the calling convention {abi} is not supported on this target"
));
});
}
}

View file

@ -3859,7 +3859,7 @@ declare_lint! {
/// This will produce:
///
/// ```text
/// warning: use of calling convention not supported on this target on function pointer
/// warning: the calling convention `"stdcall"` is not supported on this target
/// --> $DIR/unsupported.rs:34:15
/// |
/// LL | fn stdcall_ptr(f: extern "stdcall" fn()) {