Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 285df03

Browse files
authored
Rollup merge of rust-lang#132397 - m-ou-se:warn-missing-abi, r=Nadrieril
Make missing_abi lint warn-by-default. This makes the missing_abi lint warn-by-default, as suggested here: rust-lang/rfcs#3722 (comment) This needs a lang FCP.
2 parents 93ba568 + 585c976 commit 285df03

File tree

64 files changed

+198
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+198
-143
lines changed

compiler/rustc_codegen_gcc/example/mini_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ impl<T> Index<usize> for [T] {
689689
}
690690
}
691691

692-
extern {
692+
extern "C" {
693693
type VaListImpl;
694694
}
695695

compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,13 @@ fn main() {
258258

259259
assert_eq!(((|()| 42u8) as fn(()) -> u8)(()), 42);
260260

261-
extern {
261+
extern "C" {
262262
#[linkage = "weak"]
263263
static ABC: *const u8;
264264
}
265265

266266
{
267-
extern {
267+
extern "C" {
268268
#[linkage = "weak"]
269269
static ABC: *const u8;
270270
}

compiler/rustc_codegen_gcc/example/mod_bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![allow(internal_features)]
44

55
#[link(name = "c")]
6-
extern {}
6+
extern "C" {}
77

88
#[panic_handler]
99
fn panic_handler(_: &core::panic::PanicInfo<'_>) -> ! {

compiler/rustc_codegen_gcc/example/std_example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::arch::x86_64::*;
77
use std::io::Write;
88
use std::ops::Coroutine;
99

10-
extern {
10+
extern "C" {
1111
pub fn printf(format: *const i8, ...) -> i32;
1212
}
1313

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3597,7 +3597,7 @@ declare_lint! {
35973597
///
35983598
/// [Other ABIs]: https://doc.rust-lang.org/reference/items/external-blocks.html#abi
35993599
pub MISSING_ABI,
3600-
Allow,
3600+
Warn,
36013601
"No declared ABI for extern declaration"
36023602
}
36033603

src/tools/clippy/tests/ui/boxed_local.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ mod issue_3739 {
173173
/// This shouldn't warn for `boxed_local` as it is intended to called from non-Rust code.
174174
pub extern "C" fn do_not_warn_me(_c_pointer: Box<String>) -> () {}
175175

176+
#[allow(missing_abi)]
176177
#[rustfmt::skip] // Forces rustfmt to not add ABI
177178
pub extern fn do_not_warn_me_no_abi(_c_pointer: Box<String>) -> () {}
178179

src/tools/clippy/tests/ui/boxed_local.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
1414
| ^^^^^^^^^^^
1515

1616
error: local variable doesn't need to be boxed here
17-
--> tests/ui/boxed_local.rs:188:44
17+
--> tests/ui/boxed_local.rs:189:44
1818
|
1919
LL | fn default_impl_x(self: Box<Self>, x: Box<u32>) -> u32 {
2020
| ^
2121

2222
error: local variable doesn't need to be boxed here
23-
--> tests/ui/boxed_local.rs:196:16
23+
--> tests/ui/boxed_local.rs:197:16
2424
|
2525
LL | fn foo(x: Box<u32>) {}
2626
| ^

src/tools/clippy/tests/ui/doc/doc-fixable.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ fn parenthesized_word() {}
240240
/// UXes
241241
fn plural_acronym_test() {}
242242

243-
extern {
243+
extern "C" {
244244
/// `foo()`
245245
fn in_extern();
246246
}

src/tools/clippy/tests/ui/doc/doc-fixable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ fn parenthesized_word() {}
240240
/// UXes
241241
fn plural_acronym_test() {}
242242

243-
extern {
243+
extern "C" {
244244
/// foo()
245245
fn in_extern();
246246
}

src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ mod msrv {
149149
//~^ ERROR: this could be a `const fn`
150150

151151
#[rustfmt::skip]
152+
#[allow(missing_abi)]
152153
const extern fn implicit_c() {}
153154
//~^ ERROR: this could be a `const fn`
154155

0 commit comments

Comments
 (0)