]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass-fulldeps/switch-stdout.rs
rustc: Load the `rustc_trans` crate at runtime
[rust.git] / src / test / run-pass-fulldeps / switch-stdout.rs
index 16f7e2832853663452934ebbd86f0be7dc52783c..316b97f17ef94eeb44f0bcecfa24ddbec6ac6f05 100644 (file)
@@ -8,14 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_private)]
-
-extern crate tempdir;
-
+use std::env;
 use std::fs::File;
 use std::io::{Read, Write};
-
-use tempdir::TempDir;
+use std::path::PathBuf;
 
 #[cfg(unix)]
 fn switch_stdout_to(file: File) {
@@ -48,8 +44,8 @@ fn switch_stdout_to(file: File) {
 }
 
 fn main() {
-    let td = TempDir::new("foo").unwrap();
-    let path = td.path().join("bar");
+    let path = PathBuf::from(env::var_os("RUST_TEST_TMPDIR").unwrap());
+    let path = path.join("switch-stdout-output");
     let f = File::create(&path).unwrap();
 
     println!("foo");