Improve missing_abi lint by m-ou-se · Pull Request #132357 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation6 Commits2 Checks6 Files changed
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
[ Show hidden characters]({{ revealButtonHref }})
This is for the migration lint for rust-lang/rfcs#3722
It is not yet marked as an edition migration lint, because Edition2027
doesn't exist yet.
The lint now includes a machine applicable suggestion:
warning: extern declarations without an explicit ABI are deprecated
--> src/main.rs:3:1
|
3 | extern fn a() {}
| ^^^^^^ help: explicitly specify the C ABI: `extern "C"`
|
r? @lcnr
rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r?
to explicitly pick a reviewer
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
jieyouxu added S-experimental
Status: Ongoing experiment that does not require reviewing and won't be merged in its current state.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and happy to approve this if and when it is approved on the lang side.
Would like to see some explicit tests exercising that this does in fact error in edition 2024, and perhaps also exercising the error on free extern functions (extern fn() {}
) vs extern blocks.
Well, seems like from the RFC that this may be too late for 2024: rust-lang/rfcs#3722 (comment).
However, it would be very cool to pull out the edition-independent parts of this -- the change to make the suggestion applicable can still be applied to the lint, and storing the extern span seems nice to do anyways.
m-ou-se added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed S-experimental
Status: Ongoing experiment that does not require reviewing and won't be merged in its current state.
labels
m-ou-se marked this pull request as ready for review
Updated. Removed the edition stuff. This now just improves the lint. I'll send a separate PR to make it warn-by-default that can then be FCP'd.
m-ou-se changed the title
Require explicit ABI for Improve missing_abi lintextern
in Rust 2024
📌 Commit a433ea2 has been approved by compiler-errors
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…rrors
Improve missing_abi lint
This is for the migration lint for rust-lang/rfcs#3722
It is not yet marked as an edition migration lint, because Edition2027
doesn't exist yet.
The lint now includes a machine applicable suggestion:
warning: extern declarations without an explicit ABI are deprecated
--> src/main.rs:3:1
|
3 | extern fn a() {}
| ^^^^^^ help: explicitly specify the C ABI: `extern "C"`
|
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 5 pull requests
Successful merges:
- rust-lang#131168 (Fix
target_os
formipsel-sony-psx
) - rust-lang#132209 (Fix validation when lowering
?
trait bounds) - rust-lang#132357 (Improve missing_abi lint)
- rust-lang#132385 (compiler: Move
rustc_target::spec::abi::Abi
torustc_abi::ExternAbi
) - rust-lang#132417 (macOS: Document the difference between Clang's
-darwin
and-macosx
targets)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#132357 - m-ou-se:explicit-abi, r=compiler-errors
Improve missing_abi lint
This is for the migration lint for rust-lang/rfcs#3722
It is not yet marked as an edition migration lint, because Edition2027
doesn't exist yet.
The lint now includes a machine applicable suggestion:
warning: extern declarations without an explicit ABI are deprecated
--> src/main.rs:3:1
|
3 | extern fn a() {}
| ^^^^^^ help: explicitly specify the C ABI: `extern "C"`
|
Labels
Lint: missing_abi
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.