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 }})

m-ou-se

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"`
  |

@rustbot

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 rustbot added 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.

labels

Oct 30, 2024

@jieyouxu 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

Oct 30, 2024

compiler-errors

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.

@compiler-errors

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 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

Oct 31, 2024

@m-ou-se m-ou-se marked this pull request as ready for review

October 31, 2024 09:47

@m-ou-se

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 m-ou-se changed the titleRequire explicit ABI for extern in Rust 2024 Improve missing_abi lint

Oct 31, 2024

@m-ou-se

@m-ou-se

compiler-errors

@compiler-errors

@bors

📌 Commit a433ea2 has been approved by compiler-errors

It is now in the queue for this repository.

@bors 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

Oct 31, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Oct 31, 2024

@matthiaskrgr

…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

Oct 31, 2024

@bors

…iaskrgr

Rollup of 5 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Nov 1, 2024

@bors

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Nov 1, 2024

@rust-timer

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

L-missing_abi

Lint: missing_abi

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.