mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-25 23:14:12 +00:00
Test fixes and rebase conflicts
This commit is contained in:
parent
aa0db172de
commit
315730fb27
@ -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;
|
||||
|
@ -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() {}
|
||||
|
@ -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<unsafe extern fn(*mut u8)>,
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -452,6 +452,7 @@ mod imp {
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub unsafe extern fn destroy_value<T>(ptr: *mut u8) {
|
||||
let ptr = ptr as *mut Key<T>;
|
||||
// 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<T: 'static>(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
|
||||
|
@ -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<TestDescAndFn> ) {
|
||||
// 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::<Vec<_>>();
|
||||
let args = args.collect::<Vec<_>>();
|
||||
let owned_tests = tests.iter().map(|t| {
|
||||
match t.testfn {
|
||||
StaticTestFn(f) => TestDescAndFn { testfn: StaticTestFn(f), desc: t.desc.clone() },
|
||||
|
Loading…
Reference in New Issue
Block a user