From 0d8340327c03f319b49cb91e2e64aa66dd1e76c7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 30 Jul 2015 08:53:22 -0700 Subject: syntax: Don't assume `std` exists for tests This commit removes the injection of `std::env::args()` from `--test` expanded code, relying on the test runner itself to call this funciton. This is more hygienic because we can't assume that `std` exists at the top layer all the time, and it meaks the injected test module entirely self contained. --- src/libstd/sys/unix/thread.rs | 1 + src/libstd/sys/windows/thread.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs index 6be61f06926..67ecd4d9229 100644 --- a/src/libstd/sys/unix/thread.rs +++ b/src/libstd/sys/unix/thread.rs @@ -166,6 +166,7 @@ impl Drop for Thread { not(target_os = "netbsd"), not(target_os = "openbsd")))] pub mod guard { + #[cfg(stage0)] use prelude::v1::*; pub unsafe fn current() -> Option { None } diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index a4131d4cada..15df5d756be 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[cfg(stage0)] use prelude::v1::*; use alloc::boxed::FnBox; @@ -87,6 +86,7 @@ impl Thread { } pub mod guard { + #[cfg(stage0)] use prelude::v1::*; pub unsafe fn current() -> Option { None } -- cgit 1.4.1-3-g733a5