From 315730fb273c4d55c4c25d4fba2b68dcd6a54093 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 11 Feb 2015 14:40:09 -0800 Subject: [PATCH] Test fixes and rebase conflicts --- src/libcollections/bench.rs | 2 ++ src/libcollections/lib.rs | 4 ++-- src/libstd/sys/common/thread_local.rs | 4 ++++ src/libstd/sys/unix/fs2.rs | 4 +--- src/libstd/thread_local/mod.rs | 2 ++ src/libtest/lib.rs | 3 +-- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/libcollections/bench.rs b/src/libcollections/bench.rs index b59799b4997..107f6031c11 100644 --- a/src/libcollections/bench.rs +++ b/src/libcollections/bench.rs @@ -67,8 +67,10 @@ macro_rules! map_find_rand_bench { #[bench] pub fn $name(b: &mut ::test::Bencher) { use std::rand; + use std::iter::IteratorExt; use std::rand::Rng; use test::black_box; + use vec::Vec; let mut map = $map::new(); let n: usize = $n; diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index abed586e71f..460c897b6ad 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -67,6 +67,8 @@ pub use alloc::boxed; #[macro_use] mod macros; +#[cfg(test)] #[macro_use] mod bench; + pub mod binary_heap; mod bit; mod btree; @@ -104,8 +106,6 @@ pub mod btree_set { } -#[cfg(test)] #[macro_use] mod bench; - // FIXME(#14344) this shouldn't be necessary #[doc(hidden)] pub fn fixme_14344_be_sure_to_link_to_collections() {} diff --git a/src/libstd/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs index edd16e0c062..ef682902dfc 100644 --- a/src/libstd/sys/common/thread_local.rs +++ b/src/libstd/sys/common/thread_local.rs @@ -84,14 +84,17 @@ use sys::thread_local as imp; /// KEY.set(1 as *mut u8); /// } /// ``` +#[stable(feature = "rust1", since = "1.0.0")] pub struct StaticKey { /// Inner static TLS key (internals), created with by `INIT_INNER` in this /// module. + #[stable(feature = "rust1", since = "1.0.0")] pub inner: StaticKeyInner, /// Destructor for the TLS value. /// /// See `Key::new` for information about when the destructor runs and how /// it runs. + #[stable(feature = "rust1", since = "1.0.0")] pub dtor: Option, } @@ -128,6 +131,7 @@ pub struct Key { /// Constant initialization value for static TLS keys. /// /// This value specifies no destructor by default. +#[stable(feature = "rust1", since = "1.0.0")] pub const INIT: StaticKey = StaticKey { inner: INIT_INNER, dtor: None, diff --git a/src/libstd/sys/unix/fs2.rs b/src/libstd/sys/unix/fs2.rs index 06e59640b95..77d5503b683 100644 --- a/src/libstd/sys/unix/fs2.rs +++ b/src/libstd/sys/unix/fs2.rs @@ -159,9 +159,7 @@ impl OpenOptions { flags: 0, read: false, write: false, - mode: libc::S_IRUSR | libc::S_IWUSR - | libc::S_IRGRP | libc::S_IWGRP - | libc::S_IROTH | libc::S_IWOTH, + mode: 0o666, } } diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 0ec241a65e2..eab9cd84539 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -452,6 +452,7 @@ mod imp { } #[doc(hidden)] + #[stable(feature = "rust1", since = "1.0.0")] pub unsafe extern fn destroy_value(ptr: *mut u8) { let ptr = ptr as *mut Key; // Right before we run the user destructor be sure to flag the @@ -523,6 +524,7 @@ mod imp { } #[doc(hidden)] + #[stable(feature = "rust1", since = "1.0.0")] pub unsafe extern fn destroy_value(ptr: *mut u8) { // The OS TLS ensures that this key contains a NULL value when this // destructor starts to run. We set it back to a sentinel value of 1 to diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index cc7ea343ee2..cc468df87f3 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -40,7 +40,6 @@ #![feature(hash)] #![feature(int_uint)] #![feature(io)] -#![feature(os)] #![feature(path)] #![feature(rustc_private)] #![feature(staged_api)] @@ -267,7 +266,7 @@ pub fn test_main(args: &[String], tests: Vec ) { // semantics into parallel test runners, which in turn requires a ~[] // rather than a &[]. pub fn test_main_static(args: env::Args, tests: &[TestDescAndFn]) { - let args = args.map(|s| s.into_string().unwrap()).collect::>(); + let args = args.collect::>(); let owned_tests = tests.iter().map(|t| { match t.testfn { StaticTestFn(f) => TestDescAndFn { testfn: StaticTestFn(f), desc: t.desc.clone() },