Skip to content

Commit

Permalink
Auto merge of #23482 - alexcrichton:snapshots, r=aturon
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Mar 19, 2015
2 parents 94a9506 + fccf5a0 commit 12cb7c6
Show file tree
Hide file tree
Showing 56 changed files with 993 additions and 3,964 deletions.
1 change: 0 additions & 1 deletion src/liballoc/boxed.rs
Expand Up @@ -264,7 +264,6 @@ impl BoxAny for Box<Any> {
}
}

#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
impl BoxAny for Box<Any+Send> {
#[inline]
Expand Down
4 changes: 0 additions & 4 deletions src/liballoc/heap.rs
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[cfg(stage0)]
#[cfg(not(test))]
use core::ptr::PtrExt;

// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`

/// Return a pointer to `size` bytes of memory aligned to `align`.
Expand Down
3 changes: 0 additions & 3 deletions src/liballoc/rc.rs
Expand Up @@ -159,9 +159,6 @@ use core::nonzero::NonZero;
use core::ops::{Deref, Drop};
use core::option::Option;
use core::option::Option::{Some, None};
#[cfg(stage0)]
use core::ptr::{self, PtrExt};
#[cfg(not(stage0))]
use core::ptr;
use core::result::Result;
use core::result::Result::{Ok, Err};
Expand Down
6 changes: 0 additions & 6 deletions src/libarena/lib.rs
Expand Up @@ -43,12 +43,8 @@ extern crate alloc;
use std::cell::{Cell, RefCell};
use std::cmp;
use std::intrinsics;
#[cfg(stage0)] // SNAP 270a677
use std::intrinsics::{get_tydesc, TyDesc};
use std::marker;
use std::mem;
#[cfg(stage0)]
use std::num::{Int, UnsignedInt};
use std::ptr;
use std::rc::Rc;
use std::rt::heap::{allocate, deallocate};
Expand Down Expand Up @@ -190,14 +186,12 @@ fn un_bitpack_tydesc_ptr(p: usize) -> (*const TyDesc, bool) {
// HACK(eddyb) TyDesc replacement using a trait object vtable.
// This could be replaced in the future with a custom DST layout,
// or `&'static (drop_glue, size, align)` created by a `const fn`.
#[cfg(not(stage0))] // SNAP 270a677
struct TyDesc {
drop_glue: fn(*const i8),
size: usize,
align: usize
}

#[cfg(not(stage0))] // SNAP 270a677
unsafe fn get_tydesc<T>() -> *const TyDesc {
use std::raw::TraitObject;

Expand Down
3 changes: 0 additions & 3 deletions src/libcollections/btree/node.rs
Expand Up @@ -105,9 +105,6 @@ struct MutNodeSlice<'a, K: 'a, V: 'a> {
/// Fails if `target_alignment` is not a power of two.
#[inline]
fn round_up_to_next(unrounded: usize, target_alignment: usize) -> usize {
#[cfg(stage0)]
use core::num::UnsignedInt;

assert!(target_alignment.is_power_of_two());
(unrounded + target_alignment - 1) & !(target_alignment - 1)
}
Expand Down
46 changes: 3 additions & 43 deletions src/libcollections/macros.rs
Expand Up @@ -8,45 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[cfg(stage0)]
/// Creates a `Vec` containing the arguments.
///
/// `vec!` allows `Vec`s to be defined with the same syntax as array expressions.
/// There are two forms of this macro:
///
/// - Create a `Vec` containing a given list of elements:
///
/// ```
/// let v = vec![1, 2, 3];
/// assert_eq!(v[0], 1);
/// assert_eq!(v[1], 2);
/// assert_eq!(v[2], 3);
/// ```
///
/// - Create a `Vec` from a given element and size:
///
/// ```
/// let v = vec![1; 3];
/// assert_eq!(v, [1, 1, 1]);
/// ```
///
/// Note that unlike array expressions this syntax supports all elements
/// which implement `Clone` and the number of elements doesn't have to be
/// a constant.
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
macro_rules! vec {
($elem:expr; $n:expr) => (
$crate::vec::from_elem($elem, $n)
);
($($x:expr),*) => (
<[_] as $crate::slice::SliceExt>::into_vec(
$crate::boxed::Box::new([$($x),*]))
);
($($x:expr,)*) => (vec![$($x),*])
}

#[cfg(not(stage0))]
/// Creates a `Vec` containing the arguments.
///
/// `vec!` allows `Vec`s to be defined with the same syntax as array expressions.
Expand Down Expand Up @@ -84,11 +45,10 @@ macro_rules! vec {
($($x:expr,)*) => (vec![$($x),*])
}

// HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is required for this
// macro definition, is not available. Instead use the `slice::into_vec` function which is only
// available with cfg(test)
// HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is
// required for this macro definition, is not available. Instead use the
// `slice::into_vec` function which is only available with cfg(test)
// NB see the slice::hack module in slice.rs for more information
#[cfg(not(stage0))]
#[cfg(test)]
macro_rules! vec {
($elem:expr; $n:expr) => (
Expand Down

0 comments on commit 12cb7c6

Please sign in to comment.