Skip to content

Commit 3ec1451

Browse files
authored
Rollup merge of #142635 - bjorn3:add_back_wasm_spec_abi, r=workingjubilee
Temporarily add back -Zwasm-c-abi=spec This allows a more gradual transition path for projects that need to use use the spec-complaint C ABI both with older and newer rustc versions.
2 parents 55b3b66 + a88a32d commit 3ec1451

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3118,6 +3118,7 @@ pub(crate) mod dep_tracking {
31183118
}
31193119

31203120
impl_dep_tracking_hash_via_hash!(
3121+
(),
31213122
AutoDiff,
31223123
bool,
31233124
usize,

compiler/rustc_session/src/options.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ mod desc {
802802
"either a boolean (`yes`, `no`, `on`, `off`, etc), or a non-negative number";
803803
pub(crate) const parse_llvm_module_flag: &str = "<key>:<type>:<value>:<behavior>. Type must currently be `u32`. Behavior should be one of (`error`, `warning`, `require`, `override`, `append`, `appendunique`, `max`, `min`)";
804804
pub(crate) const parse_function_return: &str = "`keep` or `thunk-extern`";
805+
pub(crate) const parse_wasm_c_abi: &str = "`spec`";
805806
pub(crate) const parse_mir_include_spans: &str =
806807
"either a boolean (`yes`, `no`, `on`, `off`, etc), or `nll` (default: `nll`)";
807808
pub(crate) const parse_align: &str = "a number that is a power of 2 between 1 and 2^29";
@@ -1897,6 +1898,10 @@ pub mod parse {
18971898
true
18981899
}
18991900

1901+
pub(crate) fn parse_wasm_c_abi(_slot: &mut (), v: Option<&str>) -> bool {
1902+
v == Some("spec")
1903+
}
1904+
19001905
pub(crate) fn parse_mir_include_spans(slot: &mut MirIncludeSpans, v: Option<&str>) -> bool {
19011906
*slot = match v {
19021907
Some("on" | "yes" | "y" | "true") | None => MirIncludeSpans::On,
@@ -2631,6 +2636,11 @@ written to standard error output)"),
26312636
Requires `-Clto[=[fat,yes]]`"),
26322637
wasi_exec_model: Option<WasiExecModel> = (None, parse_wasi_exec_model, [TRACKED],
26332638
"whether to build a wasi command or reactor"),
2639+
// This option only still exists to provide a more gradual transition path for people who need
2640+
// the spec-complaint C ABI to be used.
2641+
// FIXME remove this after a couple releases
2642+
wasm_c_abi: () = ((), parse_wasm_c_abi, [TRACKED],
2643+
"use spec-compliant C ABI for `wasm32-unknown-unknown` (deprecated, always enabled)"),
26342644
write_long_types_to_disk: bool = (true, parse_bool, [UNTRACKED],
26352645
"whether long type names should be written to files instead of being printed in errors"),
26362646
// tidy-alphabetical-end

0 commit comments

Comments
 (0)