Skip to content

Commit e53f79d

Browse files
committed
Don't apply "emscripten" directives to wasm32-unknown-unknown
1 parent 733108b commit e53f79d

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)