Skip to content

Commit

Permalink
Auto merge of #83981 - nagisa:nagisa/revert-cfg-wasm, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Remove the insta-stable `cfg(wasm)`

The addition of `cfg(wasm)` was an oversight on my end that turns out to have a number
of downsides:

* It was introduced as an insta-stable addition, forgoing the usual
  staging mechanism we use for potentially far-reaching changes;
* It is a breaking change for people who are using `--cfg wasm` either
  directly or via cargo for other purposes;
* It is not entirely clear if a bare `wasm` cfg is a right option or
  whether `wasm` family of targets are special enough to warrant
  special-casing these targets specifically.

As for the last point, there appears to be a fair amount of support for
reducing the boilerplate in specifying architectures from the same
family, while ignoring their pointer width. The suggested way forward
would be to propose such a change as a separate RFC as it is potentially
a quite contentious addition.

cc #83879 `@devsnek`
  • Loading branch information
bors committed Apr 8, 2021
2 parents 1408715 + 54dc7ce commit 69e1d22
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,6 @@ pub fn default_configuration(sess: &Session) -> CrateConfig {
}
}
ret.insert((sym::target_arch, Some(Symbol::intern(arch))));
if sess.target.is_like_wasm {
ret.insert((sym::wasm, None));
}
ret.insert((sym::target_endian, Some(Symbol::intern(end.as_str()))));
ret.insert((sym::target_pointer_width, Some(Symbol::intern(&wordsz))));
ret.insert((sym::target_env, Some(Symbol::intern(env))));
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,6 @@ symbols! {
vreg,
vreg_low16,
warn,
wasm,
wasm_import_module,
wasm_target_feature,
while_let,
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/clean/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ impl<'a> fmt::Display for Display<'a> {
"windows" => "Windows",
_ => "",
},
(sym::wasm, None) => "WebAssembly",
(sym::target_arch, Some(arch)) => match &*arch.as_str() {
"aarch64" => "AArch64",
"arm" => "ARM",
Expand Down

0 comments on commit 69e1d22

Please sign in to comment.