-
Notifications
You must be signed in to change notification settings - Fork 13.4k
unsupported_calling_conventions: print which ABI this is about #142466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
RalfJung
wants to merge
19
commits into
rust-lang:master
from
RalfJung:unsupported_calling_conventions-error-msg
Closed
unsupported_calling_conventions: print which ABI this is about #142466
RalfJung
wants to merge
19
commits into
rust-lang:master
from
RalfJung:unsupported_calling_conventions-error-msg
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We modify rustc_ast_lowering to prevent all unsupported ABIs from leaking through the HIR without being checked for target support. Previously ad-hoc checking on various HIR items required making sure we check every HIR item which could contain an `extern "{abi}"` string. This is a losing proposition compared to gating the lowering itself. As a consequence, unsupported ABI strings will now hard-error instead of triggering the FCW `unsupported_fn_ptr_calling_conventions`. This FCW was upgraded to warn in dependencies in Rust 1.87 which was released on 2025 May 17, and it is now 2025 June, so it has become active within a stable Rust version. As we already had errored on these ABIs in most other positions, and have warned for fn ptrs, this breakage has had reasonable foreshadowing. However, this does cause errors for usages of `extern "{abi}"` that were theoretically writeable within source but could not actually be applied in any useful way by Rust programmers without either warning or error. For instance, trait declarations without impls were never checked. These are the exact kinds of leakages that this new approach prevents. A deprecation cycle is not useful for these marginal cases as upon impl, even default impls within traits, different HIR objects would be used. Details of our HIR analysis meant that those objects did get checked.
…ABIs Co-authored-by: Ralf Jung <[email protected]>
Co-authored-by: Ralf Jung <[email protected]>
Cherried, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-test-infra-minicore
Area: `minicore` test auxiliary and `//@ add-core-stubs`
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve the lint message to say what the problematic ABI is. When macros are involved, that can otherwise be non-trivial to figure out.
Based on #142134 to reduce conflicts.
r? @workingjubilee
(alternatively, feel free to just cherry-pick this into your PR and close this one)