Skip to content

Commit 1b4e66e

Browse files
authored
Rollup merge of #135767 - tdittr:fn_ptr_calling_conventions-in-deps, r=compiler-errors
Future incompatibility warning `unsupported_fn_ptr_calling_conventions`: Also warn in dependencies Tracking issue: #130260 As discussed [in the previous PR](https://github.com/rust-lang/rust/pull/128784/files#r1752533758) now the future incompatibility warning is enabled in dependencies. The warning was added in 1.83, while this change will get into stable in 1.86, which gives crate authors three versions to fix the warning. r? compiler-errors
2 parents d491662 + 6657aa9 commit 1b4e66e

11 files changed

+609
-7
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3782,7 +3782,7 @@ declare_lint! {
37823782
Warn,
37833783
"use of unsupported calling convention for function pointer",
37843784
@future_incompatible = FutureIncompatibleInfo {
3785-
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
3785+
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
37863786
reference: "issue #130260 <https://github.com/rust-lang/rust/issues/130260>",
37873787
};
37883788
}

tests/ui/abi/unsupported.aarch64.stderr

+110
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,113 @@ LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
206206
error: aborting due to 19 previous errors; 10 warnings emitted
207207

208208
For more information about this error, try `rustc --explain E0570`.
209+
Future incompatibility report: Future breakage diagnostic:
210+
warning: the calling convention "ptx-kernel" is not supported on this target
211+
--> $DIR/unsupported.rs:35:15
212+
|
213+
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
214+
| ^^^^^^^^^^^^^^^^^^^^^^^^
215+
|
216+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
217+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
218+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
219+
220+
Future breakage diagnostic:
221+
warning: the calling convention "aapcs" is not supported on this target
222+
--> $DIR/unsupported.rs:51:17
223+
|
224+
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
225+
| ^^^^^^^^^^^^^^^^^^^
226+
|
227+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
228+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
229+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
230+
231+
Future breakage diagnostic:
232+
warning: the calling convention "msp430-interrupt" is not supported on this target
233+
--> $DIR/unsupported.rs:73:18
234+
|
235+
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
236+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237+
|
238+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
239+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
240+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
241+
242+
Future breakage diagnostic:
243+
warning: the calling convention "avr-interrupt" is not supported on this target
244+
--> $DIR/unsupported.rs:83:15
245+
|
246+
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
247+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
248+
|
249+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
250+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
251+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
252+
253+
Future breakage diagnostic:
254+
warning: the calling convention "riscv-interrupt-m" is not supported on this target
255+
--> $DIR/unsupported.rs:96:17
256+
|
257+
LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
258+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259+
|
260+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
261+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
262+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
263+
264+
Future breakage diagnostic:
265+
warning: the calling convention "x86-interrupt" is not supported on this target
266+
--> $DIR/unsupported.rs:118:15
267+
|
268+
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
269+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
270+
|
271+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
272+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
273+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
274+
275+
Future breakage diagnostic:
276+
warning: the calling convention "thiscall" is not supported on this target
277+
--> $DIR/unsupported.rs:141:20
278+
|
279+
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
280+
| ^^^^^^^^^^^^^^^^^^^^^^
281+
|
282+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
283+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
284+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
285+
286+
Future breakage diagnostic:
287+
warning: the calling convention "stdcall" is not supported on this target
288+
--> $DIR/unsupported.rs:167:19
289+
|
290+
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
291+
| ^^^^^^^^^^^^^^^^^^^^^
292+
|
293+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
294+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
295+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
296+
297+
Future breakage diagnostic:
298+
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
299+
--> $DIR/unsupported.rs:187:21
300+
|
301+
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
302+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
303+
|
304+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
305+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
306+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
307+
308+
Future breakage diagnostic:
309+
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
310+
--> $DIR/unsupported.rs:195:22
311+
|
312+
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
313+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
314+
|
315+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
316+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
317+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
318+

tests/ui/abi/unsupported.arm.stderr

+99
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,102 @@ LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
185185
error: aborting due to 17 previous errors; 9 warnings emitted
186186

187187
For more information about this error, try `rustc --explain E0570`.
188+
Future incompatibility report: Future breakage diagnostic:
189+
warning: the calling convention "ptx-kernel" is not supported on this target
190+
--> $DIR/unsupported.rs:35:15
191+
|
192+
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
193+
| ^^^^^^^^^^^^^^^^^^^^^^^^
194+
|
195+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
196+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
197+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
198+
199+
Future breakage diagnostic:
200+
warning: the calling convention "msp430-interrupt" is not supported on this target
201+
--> $DIR/unsupported.rs:73:18
202+
|
203+
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
204+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
205+
|
206+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
207+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
208+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
209+
210+
Future breakage diagnostic:
211+
warning: the calling convention "avr-interrupt" is not supported on this target
212+
--> $DIR/unsupported.rs:83:15
213+
|
214+
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
215+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
216+
|
217+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
218+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
219+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
220+
221+
Future breakage diagnostic:
222+
warning: the calling convention "riscv-interrupt-m" is not supported on this target
223+
--> $DIR/unsupported.rs:96:17
224+
|
225+
LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
226+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
227+
|
228+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
229+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
230+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
231+
232+
Future breakage diagnostic:
233+
warning: the calling convention "x86-interrupt" is not supported on this target
234+
--> $DIR/unsupported.rs:118:15
235+
|
236+
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
237+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
238+
|
239+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
240+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
241+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
242+
243+
Future breakage diagnostic:
244+
warning: the calling convention "thiscall" is not supported on this target
245+
--> $DIR/unsupported.rs:141:20
246+
|
247+
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
248+
| ^^^^^^^^^^^^^^^^^^^^^^
249+
|
250+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
251+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
252+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
253+
254+
Future breakage diagnostic:
255+
warning: the calling convention "stdcall" is not supported on this target
256+
--> $DIR/unsupported.rs:167:19
257+
|
258+
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
259+
| ^^^^^^^^^^^^^^^^^^^^^
260+
|
261+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
262+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
263+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
264+
265+
Future breakage diagnostic:
266+
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
267+
--> $DIR/unsupported.rs:187:21
268+
|
269+
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
270+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271+
|
272+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
273+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
274+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
275+
276+
Future breakage diagnostic:
277+
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
278+
--> $DIR/unsupported.rs:195:22
279+
|
280+
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
281+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
282+
|
283+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
284+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
285+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
286+

tests/ui/abi/unsupported.i686.stderr

+77
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,80 @@ LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
143143
error: aborting due to 13 previous errors; 7 warnings emitted
144144

145145
For more information about this error, try `rustc --explain E0570`.
146+
Future incompatibility report: Future breakage diagnostic:
147+
warning: the calling convention "ptx-kernel" is not supported on this target
148+
--> $DIR/unsupported.rs:35:15
149+
|
150+
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
151+
| ^^^^^^^^^^^^^^^^^^^^^^^^
152+
|
153+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
154+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
155+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
156+
157+
Future breakage diagnostic:
158+
warning: the calling convention "aapcs" is not supported on this target
159+
--> $DIR/unsupported.rs:51:17
160+
|
161+
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
162+
| ^^^^^^^^^^^^^^^^^^^
163+
|
164+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
165+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
166+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
167+
168+
Future breakage diagnostic:
169+
warning: the calling convention "msp430-interrupt" is not supported on this target
170+
--> $DIR/unsupported.rs:73:18
171+
|
172+
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
173+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174+
|
175+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
176+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
177+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
178+
179+
Future breakage diagnostic:
180+
warning: the calling convention "avr-interrupt" is not supported on this target
181+
--> $DIR/unsupported.rs:83:15
182+
|
183+
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
184+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
185+
|
186+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
187+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
188+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
189+
190+
Future breakage diagnostic:
191+
warning: the calling convention "riscv-interrupt-m" is not supported on this target
192+
--> $DIR/unsupported.rs:96:17
193+
|
194+
LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
195+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
196+
|
197+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
198+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
199+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
200+
201+
Future breakage diagnostic:
202+
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
203+
--> $DIR/unsupported.rs:187:21
204+
|
205+
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
206+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
207+
|
208+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
209+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
210+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
211+
212+
Future breakage diagnostic:
213+
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
214+
--> $DIR/unsupported.rs:195:22
215+
|
216+
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
217+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
218+
|
219+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
220+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
221+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
222+

0 commit comments

Comments
 (0)