Skip to content

Commit aab0eee

Browse files
committed
make unsupported_calling_conventions a hard error
1 parent 91a458f commit aab0eee

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)