make unsupported_calling_conventions a hard error

This commit is contained in:
Ralf Jung 2024-09-03 18:48:15 +02:00
parent 91a458f451
commit aab0eee4ef
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 @@ mod extern_fn {
//~^ 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