Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/doc/rustc-dev-guide/src/tests/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ Some examples of `X` in `ignore-X` or `only-X`:
- OS: `android`, `emscripten`, `freebsd`, `ios`, `linux`, `macos`, `windows`,
...
- Environment (fourth word of the target triple): `gnu`, `msvc`, `musl`
- WASM: `wasm32-bare` matches `wasm32-unknown-unknown`. `emscripten` also
matches that target as well as the emscripten targets.
- WASM: `wasm32-bare` matches `wasm32-unknown-unknown`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This alias also dates back to the introduction of wasm32-unknown-unknown, and doesn't seem to serve any useful purpose compared to just writing the actual target name.

I'll leave its removal to a follow-up PR.

- Pointer width: `32bit`, `64bit`
- Endianness: `endian-big`
- Stage: `stage1`, `stage2`
Expand Down
7 changes: 1 addition & 6 deletions src/tools/compiletest/src/directives/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@ fn parse_cfg_name_directive<'a>(
message: "when the target is {name}"
}
condition! {
name: &[
Some(&*target_cfg.os),
// If something is ignored for emscripten, it likely also needs to be
// ignored for wasm32-unknown-unknown.
(config.target == "wasm32-unknown-unknown").then_some("emscripten"),
],
name: &target_cfg.os,
allowed_names: &target_cfgs.all_oses,
message: "when the operating system is {name}"
}
Expand Down
9 changes: 7 additions & 2 deletions src/tools/compiletest/src/directives/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ fn pointer_width() {
#[test]
fn wasm_special() {
let ignores = [
("wasm32-unknown-unknown", "emscripten", true),
("wasm32-unknown-unknown", "emscripten", false),
("wasm32-unknown-unknown", "wasm32", true),
("wasm32-unknown-unknown", "wasm32-bare", true),
("wasm32-unknown-unknown", "wasm64", false),
Expand All @@ -729,8 +729,13 @@ fn wasm_special() {
assert_eq!(
check_ignore(&config, &format!("//@ ignore-{pattern}")),
ignore,
"{target} {pattern}"
"target `{target}` vs `//@ ignore-{pattern}`"
);
assert_eq!(
check_ignore(&config, &format!("//@ only-{pattern}")),
!ignore,
"target `{target}` vs `//@ only-{pattern}`"
)
}
}

Expand Down
Loading