Skip to content

Commit 88ee6e5

Browse files
committed
Fix tests on wasm
The `std` test straightforwardly can't work without file descriptors; rust-lang#99417 tracks moving it out of tests/ui. `issue-13560.rs` requires the target to support dynamic linking. `extern-mod-syntax` is interesting. The original test was added to check if `extern mod` could be parsed correctly and used `extern mod std` and an import: rust-lang@138dc30#diff-73700e1e851b7a37bc92174635dab726124c82e5bfabbbc45b4a3c2e8e14fadd At some point `std::json::Object` was moved out of std to an unstable rustc-only `extras` crate, and rather than just changing the import it got changed to use the unstable crate. When `extras` was removed, people assumed the test was meant to also test rustc_private and changed it to another unstable crate rather than using something in std. This changes the test to remove the `rustc_private` import, to allow it to work properly when cross-compiling.
1 parent 2ffb0de commit 88ee6e5

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

tests/ui/extern-mod-syntax.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// run-pass
22

33
#![allow(unused_imports)]
4-
#![feature(rustc_private)]
4+
#![no_std]
55

6-
extern crate libc;
7-
use libc::c_void;
6+
extern crate std;
7+
use std::ffi::c_void;
88

99
pub fn main() {
10-
println!("Hello world!");
10+
std::println!("Hello world!");
1111
}

tests/ui/issue-13560.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
// ignore-cross-compile (needs dylibs and compiletest doesn't have a more specific header)
23
// aux-build:issue-13560-1.rs
34
// aux-build:issue-13560-2.rs
45
// aux-build:issue-13560-3.rs

tests/ui/std/switch-stdout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
// ignore-wasm (needs file descriptors and env variables)
23

34
use std::env;
45
use std::fs::File;

0 commit comments

Comments
 (0)