Skip to content

Commit 943b80e

Browse files
authored
Rollup merge of rust-lang#148969 - Zalathar:wasm32-uwu, r=jieyouxu
compiletest: Don't apply "emscripten" directives to `wasm32-unknown-unknown` This special case dates all the way back to the original introduction of the `wasm32-unknown-unknown` target, in rust-lang#45905. Either it isn't needed, in which case we should remove it, or it *is* needed, in which case we should fix the directives in any affected tests. Note that while the intent of this code was presumably to make `//@ ignore-emscripten` also ignore tests on w32-u-u, it has the unfortunate side-effect of also causing `//@ only-emscripten` tests to *run* on w32-u-u, which is potentially very confusing.
2 parents 87e6b33 + e53f79d commit 943b80e

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/doc/rustc-dev-guide/src/tests/directives.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ Some examples of `X` in `ignore-X` or `only-X`:
141141
- OS: `android`, `emscripten`, `freebsd`, `ios`, `linux`, `macos`, `windows`,
142142
...
143143
- Environment (fourth word of the target triple): `gnu`, `msvc`, `musl`
144-
- WASM: `wasm32-bare` matches `wasm32-unknown-unknown`. `emscripten` also
145-
matches that target as well as the emscripten targets.
144+
- WASM: `wasm32-bare` matches `wasm32-unknown-unknown`.
146145
- Pointer width: `32bit`, `64bit`
147146
- Endianness: `endian-big`
148147
- Stage: `stage1`, `stage2`

src/tools/compiletest/src/directives/cfg.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,7 @@ fn parse_cfg_name_directive<'a>(
112112
message: "when the target is {name}"
113113
}
114114
condition! {
115-
name: &[
116-
Some(&*target_cfg.os),
117-
// If something is ignored for emscripten, it likely also needs to be
118-
// ignored for wasm32-unknown-unknown.
119-
(config.target == "wasm32-unknown-unknown").then_some("emscripten"),
120-
],
115+
name: &target_cfg.os,
121116
allowed_names: &target_cfgs.all_oses,
122117
message: "when the operating system is {name}"
123118
}

src/tools/compiletest/src/directives/tests.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ fn pointer_width() {
708708
#[test]
709709
fn wasm_special() {
710710
let ignores = [
711-
("wasm32-unknown-unknown", "emscripten", true),
711+
("wasm32-unknown-unknown", "emscripten", false),
712712
("wasm32-unknown-unknown", "wasm32", true),
713713
("wasm32-unknown-unknown", "wasm32-bare", true),
714714
("wasm32-unknown-unknown", "wasm64", false),
@@ -729,8 +729,13 @@ fn wasm_special() {
729729
assert_eq!(
730730
check_ignore(&config, &format!("//@ ignore-{pattern}")),
731731
ignore,
732-
"{target} {pattern}"
732+
"target `{target}` vs `//@ ignore-{pattern}`"
733733
);
734+
assert_eq!(
735+
check_ignore(&config, &format!("//@ only-{pattern}")),
736+
!ignore,
737+
"target `{target}` vs `//@ only-{pattern}`"
738+
)
734739
}
735740
}
736741

0 commit comments

Comments
 (0)