1
Fork 0

Rollup merge of #132357 - m-ou-se:explicit-abi, r=compiler-errors

Improve missing_abi lint

This is for the migration lint for https://github.com/rust-lang/rfcs/pull/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"`
  |
```
This commit is contained in:
Jubilee 2024-10-31 17:50:41 -07:00 committed by GitHub
commit 6b0c8cfedc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 17 additions and 19 deletions

View file

@ -2738,11 +2738,9 @@ pub(crate) struct PatternsInFnsWithoutBodySub {
#[derive(LintDiagnostic)]
#[diag(lint_extern_without_abi)]
#[help]
pub(crate) struct MissingAbi {
#[label]
#[suggestion(code = "extern \"{default_abi}\"", applicability = "machine-applicable")]
pub span: Span,
pub default_abi: &'static str,
}