Skip to content

Commit ff1636b

Browse files
Rollup merge of #142134 - workingjubilee:reject-unsupported-abi, r=jdonszelmann,RalfJung
Reject unsupported `extern "{abi}"`s consistently in all positions Modify the handling of `extern "{abi}"` in the compiler so that it has consistent errors without regard to the position in the grammar. ## What Implement the following breakages: - Promote [`unsupported_fn_ptr_calling_conventions`] from a warning to a hard error - Guarantee future edge-cases like trait declarations will not escape so that *ABIs that have already been unusable in most positions* will now be unusable in **all positions**. See "How" and "Why or Why Not" for more details. In particular, these architecture-specific ABIs now only compile on their architectures[^4]: - amdgpu: "gpu-kernel" - arm: "aapcs", "C-cmse-nonsecure-entry", "C-cmse-nonsecure-call" - avr: "avr-interrupt", "avr-non-blocking-interrupt" - msp430: "msp430-interrupt" - nvptx64: "gpu-kernel", "ptx-kernel" - riscv32 and riscv64: "riscv-interrupt-m", "riscv-interrupt-s" - x86: "thiscall" - x86 and x86_64: "x86-interrupt" - x86_64: "sysv64", "win64" ABIs that are logically x86-specific but actually permitted on all Windows targets remain permitted on Windows, as before. For non-Windows targets, they error if we had previously done so in other positions. ## How We modify rustc_ast_lowering to prevent unsupported ABIs from leaking through the HIR without being checked for target support. They now emit hard errors for every case where we would return `Invalid` from `AbiMap::canonize_abi`. Previously ad-hoc checking on various HIR items required making sure we check every HIR item which could contain an `extern "{abi}"` string. This is a losing proposition compared to gating the lowering itself. As a consequence, unsupported ABI strings error instead of triggering the warning `unsupported_fn_ptr_calling_conventions`. The code is also simpler compared to alternative implementations that might e.g. split on unstable vs. stable, only suffering some unavoidable complication to support the newly-revived `unsupported_calling_conventions` lint.[^5] However, per #86232 this does cause errors for rare usages of `extern "{abi}"` that were theoretically possible to write in Rust source, without previous warning or error. For instance, trait declarations without impls were never checked. These are the exact kinds of leakages that this new approach prevents. This differs from the following PRs: - #141435 is orthogonal, as it adds a new lint for ABIs we have not warned on and are not touched by this PR - #141877 is subsumed by this, in that this simply cuts out bad functionality instead of adding epicycles for stable code ## Why or Why Not We already made the decision to issue the `unsupported_fn_ptr_calling_conventions` future compatibility warning. It has warned in dependencies since #135767, which reached stable with Rust 1.87. That was released on 2025 May 17, and it is now June. As we already had erred on these ABI strings in most other positions, and warn on stable for function pointer types, this breakage has had reasonable foreshadowing. Upgrading the warning to an error addresses a real problem. In some cases the Rust compiler can attempt to actually compute the ABI for calling a function with an unsupported ABI. We could accept this case and compute unsupported ABIs according to some other ABI, silently[^6]. However, this obviously exposes Rust to errors in codegen. We cannot lower directly to the "obvious", target-incorrect ABI and then trust code generators like LLVM to reliably error on these cases, either. Other considerations include: - We could refactor the compiler to defer ABI computations, but that seems like it would suffer the "whack-a-mole" problem close to linking instead of after parsing and expansion. - We could run a deprecation cycle for the edge cases, but we would be warning highly marginal cases, like this trait declaration without a definition that cannot be implemented without error[^9]. ```rust pub trait UsedToSneakBy { pub extern "gpu-kernel" fn sneaky(); } ``` - The [crater run] on this PR's draft form suggests the primary issue is with implementations on function pointers, which has already been warned on, so it does not seem like we would be benefiting any real code. - Converting this to a hard error now, in the same cycle that we ship the reanimation of the `unsupported_calling_conventions` lint, means people who would otherwise have to deal with two lints only have to update their code in one batch. Of course, one of them is as breakage. r? lang Fixes #86232 Fixes #132430 Fixes #138738 Fixes #142107 [`unsupported_fn_ptr_calling_conventions`]: #130260 [crater run]: #142134 (comment) [^9]: Upon any impl, even for provided fn within trait declarations, e.g. `pub extern "gpu-kernel" fn sneaky() {}`, different HIR types were used which would, in fact, get checked. Likewise for anything with function pointers. Thus we would be discussing deprecation cycles for code that is impotent or forewarned[^7]. [^4]: Some already will not compile, due to reaching ICEs or LLVM errors. [^5]: That lint cannot be moved in a similar way yet because lints operate on HIR, so you cannot emit lints when the HIR has not been completely formed. [^6]: We already do this for all `AbiStr` we cannot parse, pretending they are `ExternAbi::Rust`, but we also emit an error to prevent reaching too far into codegen. [^7]: It actually did appear in two cases in rustc's test suite because we are a collection of Rust edge-cases by the simple fact that we don't care if the code actually runs. These cases are being excised in 643a9d2
2 parents fc3d7ee + aa25b9b commit ff1636b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1288
-2749
lines changed

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_abi::ExternAbi;
22
use rustc_ast::ptr::P;
33
use rustc_ast::visit::AssocCtxt;
44
use rustc_ast::*;
5-
use rustc_errors::ErrorGuaranteed;
5+
use rustc_errors::{E0570, ErrorGuaranteed, struct_span_code_err};
66
use rustc_hir::def::{DefKind, PerNS, Res};
77
use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
88
use rustc_hir::{self as hir, HirId, LifetimeSource, PredicateOrigin};
@@ -1644,9 +1644,29 @@ impl<'hir> LoweringContext<'_, 'hir> {
16441644
self.error_on_invalid_abi(abi_str);
16451645
ExternAbi::Rust
16461646
});
1647-
let sess = self.tcx.sess;
1648-
let features = self.tcx.features();
1649-
gate_unstable_abi(sess, features, span, extern_abi);
1647+
let tcx = self.tcx;
1648+
1649+
// we can't do codegen for unsupported ABIs, so error now so we won't get farther
1650+
if !tcx.sess.target.is_abi_supported(extern_abi) {
1651+
let mut err = struct_span_code_err!(
1652+
tcx.dcx(),
1653+
span,
1654+
E0570,
1655+
"{extern_abi} is not a supported ABI for the current target",
1656+
);
1657+
1658+
if let ExternAbi::Stdcall { unwind } = extern_abi {
1659+
let c_abi = ExternAbi::C { unwind };
1660+
let system_abi = ExternAbi::System { unwind };
1661+
err.help(format!("if you need `extern {extern_abi}` on win32 and `extern {c_abi}` everywhere else, \
1662+
use `extern {system_abi}`"
1663+
));
1664+
}
1665+
err.emit();
1666+
}
1667+
// Show required feature gate even if we already errored, as the user is likely to build the code
1668+
// for the actually intended target next and then they will need the feature gate.
1669+
gate_unstable_abi(tcx.sess, tcx.features(), span, extern_abi);
16501670
extern_abi
16511671
}
16521672

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::cell::LazyCell;
22
use std::ops::ControlFlow;
33

4-
use rustc_abi::FieldIdx;
4+
use rustc_abi::{ExternAbi, FieldIdx};
55
use rustc_attr_data_structures::ReprAttr::ReprPacked;
66
use rustc_attr_data_structures::{AttributeKind, find_attr};
77
use rustc_data_structures::unord::{UnordMap, UnordSet};
@@ -13,7 +13,6 @@ use rustc_infer::infer::{RegionVariableOrigin, TyCtxtInferExt};
1313
use rustc_infer::traits::{Obligation, ObligationCauseCode};
1414
use rustc_lint_defs::builtin::{
1515
REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS, UNSUPPORTED_CALLING_CONVENTIONS,
16-
UNSUPPORTED_FN_PTR_CALLING_CONVENTIONS,
1716
};
1817
use rustc_middle::hir::nested_filter;
1918
use rustc_middle::middle::resolve_bound_vars::ResolvedArg;
@@ -53,49 +52,22 @@ fn add_abi_diag_help<T: EmissionGuarantee>(abi: ExternAbi, diag: &mut Diag<'_, T
5352
}
5453

5554
pub fn check_abi(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: ExternAbi) {
56-
// FIXME: this should be checked earlier, e.g. in `rustc_ast_lowering`, to fix
57-
// things like #86232.
55+
// FIXME: This should be checked earlier, e.g. in `rustc_ast_lowering`, as this
56+
// currently only guards function imports, function definitions, and function pointer types.
57+
// Functions in trait declarations can still use "deprecated" ABIs without any warning.
5858

5959
match AbiMap::from_target(&tcx.sess.target).canonize_abi(abi, false) {
6060
AbiMapping::Direct(..) => (),
61+
// already erred in rustc_ast_lowering
6162
AbiMapping::Invalid => {
62-
let mut err = struct_span_code_err!(
63-
tcx.dcx(),
64-
span,
65-
E0570,
66-
"`{abi}` is not a supported ABI for the current target",
67-
);
68-
add_abi_diag_help(abi, &mut err);
69-
err.emit();
63+
tcx.dcx().span_delayed_bug(span, format!("{abi} should be rejected in ast_lowering"));
7064
}
7165
AbiMapping::Deprecated(..) => {
7266
tcx.node_span_lint(UNSUPPORTED_CALLING_CONVENTIONS, hir_id, span, |lint| {
73-
lint.primary_message("use of calling convention not supported on this target");
74-
add_abi_diag_help(abi, lint);
75-
});
76-
}
77-
}
78-
}
79-
80-
pub fn check_abi_fn_ptr(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: ExternAbi) {
81-
// This is always an FCW, even for `AbiMapping::Invalid`, since we started linting later than
82-
// in `check_abi` above.
83-
match AbiMap::from_target(&tcx.sess.target).canonize_abi(abi, false) {
84-
AbiMapping::Direct(..) => (),
85-
// This is not a redundant match arm: these ABIs started linting after introducing
86-
// UNSUPPORTED_FN_PTR_CALLING_CONVENTIONS already existed and we want to
87-
// avoid expanding the scope of that lint so it can move to a hard error sooner.
88-
AbiMapping::Deprecated(..) => {
89-
tcx.node_span_lint(UNSUPPORTED_CALLING_CONVENTIONS, hir_id, span, |lint| {
90-
lint.primary_message("use of calling convention not supported on this target");
91-
add_abi_diag_help(abi, lint);
92-
});
93-
}
94-
AbiMapping::Invalid => {
95-
tcx.node_span_lint(UNSUPPORTED_FN_PTR_CALLING_CONVENTIONS, hir_id, span, |lint| {
9667
lint.primary_message(format!(
97-
"the calling convention {abi} is not supported on this target"
68+
"{abi} is not a supported ABI for the current target"
9869
));
70+
add_abi_diag_help(abi, lint);
9971
});
10072
}
10173
}
@@ -868,6 +840,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
868840
let hir::ItemKind::ForeignMod { abi, items } = it.kind else {
869841
return;
870842
};
843+
871844
check_abi(tcx, it.hir_id(), it.span, abi);
872845

873846
for item in items {

compiler/rustc_hir_analysis/src/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ pub mod wfcheck;
7272

7373
use std::num::NonZero;
7474

75-
pub use check::{check_abi, check_abi_fn_ptr, check_custom_abi};
76-
use rustc_abi::{ExternAbi, VariantIdx};
75+
pub use check::{check_abi, check_custom_abi};
76+
use rustc_abi::VariantIdx;
7777
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
7878
use rustc_errors::{Diag, ErrorGuaranteed, pluralize, struct_span_code_err};
7979
use rustc_hir::LangItem;

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use rustc_trait_selection::traits::wf::object_region_bounds;
5151
use rustc_trait_selection::traits::{self, FulfillmentError};
5252
use tracing::{debug, instrument};
5353

54-
use crate::check::check_abi_fn_ptr;
54+
use crate::check::check_abi;
5555
use crate::errors::{AmbiguousLifetimeBound, BadReturnTypeNotation};
5656
use crate::hir_ty_lowering::errors::{GenericsArgsErrExtend, prohibit_assoc_item_constraint};
5757
use crate::hir_ty_lowering::generics::{check_generic_arg_count, lower_generic_args};
@@ -2660,7 +2660,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
26602660
if let hir::Node::Ty(hir::Ty { kind: hir::TyKind::BareFn(bare_fn_ty), span, .. }) =
26612661
tcx.hir_node(hir_id)
26622662
{
2663-
check_abi_fn_ptr(tcx, hir_id, *span, bare_fn_ty.abi);
2663+
check_abi(tcx, hir_id, *span, bare_fn_ty.abi);
26642664
}
26652665

26662666
// reject function types that violate cmse ABI requirements

compiler/rustc_lint/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ fn register_builtins(store: &mut LintStore) {
608608
"converted into hard error, see issue #127323 \
609609
<https://github.com/rust-lang/rust/issues/127323> for more information",
610610
);
611+
store.register_removed("unsupported_fn_ptr_calling_conventions", "converted into hard error");
611612
store.register_removed(
612613
"undefined_naked_function_abi",
613614
"converted into hard error, see PR #139001 \

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ declare_lint_pass! {
122122
UNSAFE_OP_IN_UNSAFE_FN,
123123
UNSTABLE_NAME_COLLISIONS,
124124
UNSTABLE_SYNTAX_PRE_EXPANSION,
125-
UNSUPPORTED_FN_PTR_CALLING_CONVENTIONS,
126125
UNUSED_ASSIGNMENTS,
127126
UNUSED_ASSOCIATED_TYPE_BOUNDS,
128127
UNUSED_ATTRIBUTES,

tests/auxiliary/minicore.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#![feature(
1818
no_core,
19+
intrinsics,
1920
lang_items,
2021
auto_traits,
2122
freeze_impls,
@@ -196,3 +197,9 @@ impl<'a, 'b: 'a, T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<&'a
196197
trait Drop {
197198
fn drop(&mut self);
198199
}
200+
201+
pub mod mem {
202+
#[rustc_nounwind]
203+
#[rustc_intrinsic]
204+
pub unsafe fn transmute<Src, Dst>(src: Src) -> Dst;
205+
}

tests/crashes/132430.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/crashes/138738.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 37 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,75 @@
1-
warning: the calling convention "msp430-interrupt" is not supported on this target
2-
--> $DIR/cannot-be-called.rs:60:18
1+
error[E0570]: "msp430-interrupt" is not a supported ABI for the current target
2+
--> $DIR/cannot-be-called.rs:38:8
33
|
4-
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
9-
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
4+
LL | extern "msp430-interrupt" fn msp430() {}
5+
| ^^^^^^^^^^^^^^^^^^
106

11-
warning: the calling convention "riscv-interrupt-m" is not supported on this target
12-
--> $DIR/cannot-be-called.rs:74:19
13-
|
14-
LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) {
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target
8+
--> $DIR/cannot-be-called.rs:42:8
169
|
17-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
18-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
10+
LL | extern "riscv-interrupt-m" fn riscv_m() {}
11+
| ^^^^^^^^^^^^^^^^^^^
1912

20-
warning: the calling convention "riscv-interrupt-s" is not supported on this target
21-
--> $DIR/cannot-be-called.rs:81:19
22-
|
23-
LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) {
24-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13+
error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target
14+
--> $DIR/cannot-be-called.rs:44:8
2515
|
26-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
27-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
16+
LL | extern "riscv-interrupt-s" fn riscv_s() {}
17+
| ^^^^^^^^^^^^^^^^^^^
2818

29-
warning: the calling convention "x86-interrupt" is not supported on this target
30-
--> $DIR/cannot-be-called.rs:88:15
19+
error[E0570]: "x86-interrupt" is not a supported ABI for the current target
20+
--> $DIR/cannot-be-called.rs:46:8
3121
|
32-
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
33-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
34-
|
35-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
36-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
22+
LL | extern "x86-interrupt" fn x86() {}
23+
| ^^^^^^^^^^^^^^^
3724

38-
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
39-
--> $DIR/cannot-be-called.rs:36:1
25+
error[E0570]: "msp430-interrupt" is not a supported ABI for the current target
26+
--> $DIR/cannot-be-called.rs:65:25
4027
|
41-
LL | extern "msp430-interrupt" fn msp430() {}
42-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28+
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
29+
| ^^^^^^^^^^^^^^^^^^
4330

44-
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
45-
--> $DIR/cannot-be-called.rs:40:1
31+
error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target
32+
--> $DIR/cannot-be-called.rs:77:26
4633
|
47-
LL | extern "riscv-interrupt-m" fn riscv_m() {}
48-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) {
35+
| ^^^^^^^^^^^^^^^^^^^
4936

50-
error[E0570]: `"riscv-interrupt-s"` is not a supported ABI for the current target
51-
--> $DIR/cannot-be-called.rs:42:1
37+
error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target
38+
--> $DIR/cannot-be-called.rs:83:26
5239
|
53-
LL | extern "riscv-interrupt-s" fn riscv_s() {}
54-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) {
41+
| ^^^^^^^^^^^^^^^^^^^
5542

56-
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
57-
--> $DIR/cannot-be-called.rs:44:1
43+
error[E0570]: "x86-interrupt" is not a supported ABI for the current target
44+
--> $DIR/cannot-be-called.rs:89:22
5845
|
59-
LL | extern "x86-interrupt" fn x86() {}
60-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46+
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
47+
| ^^^^^^^^^^^^^^^
6148

6249
error: functions with the "avr-interrupt" ABI cannot be called
63-
--> $DIR/cannot-be-called.rs:50:5
50+
--> $DIR/cannot-be-called.rs:53:5
6451
|
6552
LL | avr();
6653
| ^^^^^
6754
|
6855
note: an `extern "avr-interrupt"` function can only be called using inline assembly
69-
--> $DIR/cannot-be-called.rs:50:5
56+
--> $DIR/cannot-be-called.rs:53:5
7057
|
7158
LL | avr();
7259
| ^^^^^
7360

7461
error: functions with the "avr-interrupt" ABI cannot be called
75-
--> $DIR/cannot-be-called.rs:70:5
62+
--> $DIR/cannot-be-called.rs:73:5
7663
|
7764
LL | f()
7865
| ^^^
7966
|
8067
note: an `extern "avr-interrupt"` function can only be called using inline assembly
81-
--> $DIR/cannot-be-called.rs:70:5
68+
--> $DIR/cannot-be-called.rs:73:5
8269
|
8370
LL | f()
8471
| ^^^
8572

86-
error: aborting due to 6 previous errors; 4 warnings emitted
73+
error: aborting due to 10 previous errors
8774

8875
For more information about this error, try `rustc --explain E0570`.
89-
Future incompatibility report: Future breakage diagnostic:
90-
warning: the calling convention "msp430-interrupt" is not supported on this target
91-
--> $DIR/cannot-be-called.rs:60:18
92-
|
93-
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
94-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95-
|
96-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
97-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
98-
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
99-
100-
Future breakage diagnostic:
101-
warning: the calling convention "riscv-interrupt-m" is not supported on this target
102-
--> $DIR/cannot-be-called.rs:74:19
103-
|
104-
LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) {
105-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106-
|
107-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
108-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
109-
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
110-
111-
Future breakage diagnostic:
112-
warning: the calling convention "riscv-interrupt-s" is not supported on this target
113-
--> $DIR/cannot-be-called.rs:81:19
114-
|
115-
LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) {
116-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117-
|
118-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
119-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
120-
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
121-
122-
Future breakage diagnostic:
123-
warning: the calling convention "x86-interrupt" is not supported on this target
124-
--> $DIR/cannot-be-called.rs:88:15
125-
|
126-
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
127-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
128-
|
129-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
130-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
131-
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
132-

0 commit comments

Comments
 (0)