Auto merge of #129935 - RalfJung:unsupported_calling_conventions, r=compiler-errors

make unsupported_calling_conventions a hard error

This has been a future-compat lint (not shown in dependencies) since Rust 1.55, released 3 years ago. Hopefully that was enough time so this can be made a hard error now. Given that long timeframe, I think it's justified to skip the "show in dependencies" stage. There were [not many crates hitting this](https://github.com/rust-lang/rust/pull/86231#issuecomment-866300943) even when the lint was originally added.

This should get cratered, and I assume then it needs a t-compiler FCP. (t-compiler because this looks entirely like an implementation oversight -- for the vast majority of ABIs, we already have a hard error, but some were initially missed, and we are finally fixing that.)

Fixes https://github.com/rust-lang/rust/pull/87678
This commit is contained in:
bors 2024-10-22 03:24:40 +00:00
commit f03f7c6c9d
3 changed files with 14 additions and 14 deletions

View File

@ -1,7 +1,7 @@
#![warn(clippy::missing_const_for_fn)] #![warn(clippy::missing_const_for_fn)]
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)] #![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
#![allow(unsupported_calling_conventions)] #![feature(const_trait_impl, abi_vectorcall)]
#![feature(const_trait_impl)]
use std::mem::transmute; use std::mem::transmute;
@ -212,8 +212,8 @@ mod extern_fn {
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
const extern "system-unwind" fn system_unwind() {} const extern "system-unwind" fn system_unwind() {}
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
pub const extern "stdcall" fn std_call() {} pub const extern "vectorcall" fn std_call() {}
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
pub const extern "stdcall-unwind" fn std_call_unwind() {} pub const extern "vectorcall-unwind" fn std_call_unwind() {}
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
} }

View File

@ -1,7 +1,7 @@
#![warn(clippy::missing_const_for_fn)] #![warn(clippy::missing_const_for_fn)]
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)] #![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
#![allow(unsupported_calling_conventions)] #![feature(const_trait_impl, abi_vectorcall)]
#![feature(const_trait_impl)]
use std::mem::transmute; use std::mem::transmute;
@ -212,8 +212,8 @@ extern "system" fn system() {}
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
extern "system-unwind" fn system_unwind() {} extern "system-unwind" fn system_unwind() {}
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
pub extern "stdcall" fn std_call() {} pub extern "vectorcall" fn std_call() {}
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
pub extern "stdcall-unwind" fn std_call_unwind() {} pub extern "vectorcall-unwind" fn std_call_unwind() {}
//~^ ERROR: this could be a `const fn` //~^ ERROR: this could be a `const fn`
} }

View File

@ -319,23 +319,23 @@ LL | const extern "system-unwind" fn system_unwind() {}
error: this could be a `const fn` error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:215:5 --> tests/ui/missing_const_for_fn/could_be_const.rs:215:5
| |
LL | pub extern "stdcall" fn std_call() {} LL | pub extern "vectorcall" fn std_call() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
help: make the function `const` help: make the function `const`
| |
LL | pub const extern "stdcall" fn std_call() {} LL | pub const extern "vectorcall" fn std_call() {}
| +++++ | +++++
error: this could be a `const fn` error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:217:5 --> tests/ui/missing_const_for_fn/could_be_const.rs:217:5
| |
LL | pub extern "stdcall-unwind" fn std_call_unwind() {} LL | pub extern "vectorcall-unwind" fn std_call_unwind() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
help: make the function `const` help: make the function `const`
| |
LL | pub const extern "stdcall-unwind" fn std_call_unwind() {} LL | pub const extern "vectorcall-unwind" fn std_call_unwind() {}
| +++++ | +++++
error: aborting due to 26 previous errors error: aborting due to 26 previous errors