Skip to content

Commit

Permalink
Auto merge of #129935 - RalfJung:unsupported_calling_conventions, r=c…
Browse files Browse the repository at this point in the history
…ompiler-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](rust-lang/rust#86231 (comment)) 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 rust-lang/rust#87678
  • Loading branch information
bors committed Oct 22, 2024
2 parents 1d0dad5 + aab0eee commit f03f7c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/ui/missing_const_for_fn/could_be_const.fixed
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![warn(clippy::missing_const_for_fn)]
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
#![allow(unsupported_calling_conventions)]
#![feature(const_trait_impl)]
#![feature(const_trait_impl, abi_vectorcall)]


use std::mem::transmute;

Expand Down Expand Up @@ -212,8 +212,8 @@ mod extern_fn {
//~^ ERROR: this could be a `const fn`
const extern "system-unwind" fn system_unwind() {}
//~^ 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`
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`
}
8 changes: 4 additions & 4 deletions tests/ui/missing_const_for_fn/could_be_const.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![warn(clippy::missing_const_for_fn)]
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
#![allow(unsupported_calling_conventions)]
#![feature(const_trait_impl)]
#![feature(const_trait_impl, abi_vectorcall)]


use std::mem::transmute;

Expand Down Expand Up @@ -212,8 +212,8 @@ mod extern_fn {
//~^ ERROR: this could be a `const fn`
extern "system-unwind" fn system_unwind() {}
//~^ 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`
pub extern "stdcall-unwind" fn std_call_unwind() {}
pub extern "vectorcall-unwind" fn std_call_unwind() {}
//~^ ERROR: this could be a `const fn`
}
12 changes: 6 additions & 6 deletions tests/ui/missing_const_for_fn/could_be_const.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -319,23 +319,23 @@ LL | const extern "system-unwind" fn system_unwind() {}
error: this could be a `const fn`
--> 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`
|
LL | pub const extern "stdcall" fn std_call() {}
LL | pub const extern "vectorcall" fn std_call() {}
| +++++

error: this could be a `const fn`
--> 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`
|
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
Expand Down

0 comments on commit f03f7c6

Please sign in to comment.