Add [`extern_without_abi`] lint
Fixes #13372
The [extern_without_abi] lint emits when extern is not followed by an ABI. For example:
// EMIT
extern fn foo() {}
// EMIT
extern {
fn bar();
}
// NO EMIT
extern "C" fn baz() {}
// NO EMIT
extern "C" {
fn foo_bar();
}
changelog: Add [extern_without_abi] lint
r? @Centri3
rustbot has assigned @Centri3. 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
:umbrella: The latest upstream changes (presumably #13322) made this pull request unmergeable. Please resolve the merge conflicts.
:umbrella: The latest upstream changes (presumably #13440) made this pull request unmergeable. Please resolve the merge conflicts.
Thank you for reviewing the PR. It should include the changes you requested. I went ahead and squashed and merged the changes with the latest from master.
:umbrella: The latest upstream changes (presumably #13334) made this pull request unmergeable. Please resolve the merge conflicts.
:umbrella: The latest upstream changes (presumably #13395) made this pull request unmergeable. Please resolve the merge conflicts.
In addition to fixing the merge conflicts, I moved is_from_proc_macro test to last since it seems to be the most expensive. Also made a minor change to a string literal to improve readability.
There's the missing_abi rustc lint that sounds like the same as what this adds, or is there a difference? rust-lang/rust#132397 makes that rustc lint warn-by-default
I guess missing_abi already checks for this, and therefore this PR isn't needed.
There is one difference, this lint emits a diagnostic with a suggestion. I don't believe missing_abi does.