Skip to content

Commit f03f7c6

Browse files
committed
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](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
2 parents 1d0dad5 + aab0eee commit f03f7c6

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

tests/ui/missing_const_for_fn/could_be_const.fixed

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(clippy::missing_const_for_fn)]
22
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
3-
#![allow(unsupported_calling_conventions)]
4-
#![feature(const_trait_impl)]
3+
#![feature(const_trait_impl, abi_vectorcall)]
4+
55

66
use std::mem::transmute;
77

@@ -212,8 +212,8 @@ mod extern_fn {
212212
//~^ ERROR: this could be a `const fn`
213213
const extern "system-unwind" fn system_unwind() {}
214214
//~^ ERROR: this could be a `const fn`
215-
pub const extern "stdcall" fn std_call() {}
215+
pub const extern "vectorcall" fn std_call() {}
216216
//~^ ERROR: this could be a `const fn`
217-
pub const extern "stdcall-unwind" fn std_call_unwind() {}
217+
pub const extern "vectorcall-unwind" fn std_call_unwind() {}
218218
//~^ ERROR: this could be a `const fn`
219219
}

tests/ui/missing_const_for_fn/could_be_const.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(clippy::missing_const_for_fn)]
22
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
3-
#![allow(unsupported_calling_conventions)]
4-
#![feature(const_trait_impl)]
3+
#![feature(const_trait_impl, abi_vectorcall)]
4+
55

66
use std::mem::transmute;
77

@@ -212,8 +212,8 @@ mod extern_fn {
212212
//~^ ERROR: this could be a `const fn`
213213
extern "system-unwind" fn system_unwind() {}
214214
//~^ ERROR: this could be a `const fn`
215-
pub extern "stdcall" fn std_call() {}
215+
pub extern "vectorcall" fn std_call() {}
216216
//~^ ERROR: this could be a `const fn`
217-
pub extern "stdcall-unwind" fn std_call_unwind() {}
217+
pub extern "vectorcall-unwind" fn std_call_unwind() {}
218218
//~^ ERROR: this could be a `const fn`
219219
}

tests/ui/missing_const_for_fn/could_be_const.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -319,23 +319,23 @@ LL | const extern "system-unwind" fn system_unwind() {}
319319
error: this could be a `const fn`
320320
--> tests/ui/missing_const_for_fn/could_be_const.rs:215:5
321321
|
322-
LL | pub extern "stdcall" fn std_call() {}
323-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
322+
LL | pub extern "vectorcall" fn std_call() {}
323+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
324324
|
325325
help: make the function `const`
326326
|
327-
LL | pub const extern "stdcall" fn std_call() {}
327+
LL | pub const extern "vectorcall" fn std_call() {}
328328
| +++++
329329

330330
error: this could be a `const fn`
331331
--> tests/ui/missing_const_for_fn/could_be_const.rs:217:5
332332
|
333-
LL | pub extern "stdcall-unwind" fn std_call_unwind() {}
334-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
333+
LL | pub extern "vectorcall-unwind" fn std_call_unwind() {}
334+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
335335
|
336336
help: make the function `const`
337337
|
338-
LL | pub const extern "stdcall-unwind" fn std_call_unwind() {}
338+
LL | pub const extern "vectorcall-unwind" fn std_call_unwind() {}
339339
| +++++
340340

341341
error: aborting due to 26 previous errors

0 commit comments

Comments
 (0)