From 8211539114df8b6e3a9b8b251fa57cb5a77d2f14 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 14 May 2014 14:24:41 -0700 Subject: [PATCH] Register new snapshots --- src/libcore/lib.rs | 3 -- src/libcore/owned.rs | 101 ------------------------------------------- src/libstd/lib.rs | 7 +-- src/snapshots.txt | 8 ++++ 4 files changed, 10 insertions(+), 109 deletions(-) delete mode 100644 src/libcore/owned.rs diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 4eab7e9d45d..9e3a92981e5 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -116,9 +116,6 @@ pub mod slice; pub mod str; pub mod tuple; -#[cfg(stage0, not(test))] -pub mod owned; - // FIXME: this module should not exist. Once owned allocations are no longer a // language type, this module can move outside to the owned allocation // crate. diff --git a/src/libcore/owned.rs b/src/libcore/owned.rs deleted file mode 100644 index 3af12c5154c..00000000000 --- a/src/libcore/owned.rs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Operations on unique pointer types - -use any::{Any, AnyRefExt}; -use clone::Clone; -use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering}; -use default::Default; -use intrinsics; -use mem; -use raw::TraitObject; -use result::{Ok, Err, Result}; - -/// A value that represents the global exchange heap. This is the default -/// place that the `box` keyword allocates into when no place is supplied. -/// -/// The following two examples are equivalent: -/// -/// let foo = box(HEAP) Bar::new(...); -/// let foo = box Bar::new(...); -#[lang="exchange_heap"] -pub static HEAP: () = (); - -/// A type that represents a uniquely-owned value. -#[lang="owned_box"] -pub struct Box(*T); - -impl Default for Box { - fn default() -> Box { box Default::default() } -} - -impl Clone for Box { - /// Return a copy of the owned box. - #[inline] - fn clone(&self) -> Box { box {(**self).clone()} } - - /// Perform copy-assignment from `source` by reusing the existing allocation. - #[inline] - fn clone_from(&mut self, source: &Box) { - (**self).clone_from(&(**source)); - } -} - -// box pointers -impl Eq for Box { - #[inline] - fn eq(&self, other: &Box) -> bool { *(*self) == *(*other) } - #[inline] - fn ne(&self, other: &Box) -> bool { *(*self) != *(*other) } -} -impl Ord for Box { - #[inline] - fn lt(&self, other: &Box) -> bool { *(*self) < *(*other) } - #[inline] - fn le(&self, other: &Box) -> bool { *(*self) <= *(*other) } - #[inline] - fn ge(&self, other: &Box) -> bool { *(*self) >= *(*other) } - #[inline] - fn gt(&self, other: &Box) -> bool { *(*self) > *(*other) } -} -impl TotalOrd for Box { - #[inline] - fn cmp(&self, other: &Box) -> Ordering { (**self).cmp(*other) } -} -impl TotalEq for Box {} - -/// Extension methods for an owning `Any` trait object -pub trait AnyOwnExt { - /// Returns the boxed value if it is of type `T`, or - /// `Err(Self)` if it isn't. - fn move(self) -> Result, Self>; -} - -impl AnyOwnExt for Box { - #[inline] - fn move(self) -> Result, Box> { - if self.is::() { - unsafe { - // Get the raw representation of the trait object - let to: TraitObject = - *mem::transmute::<&Box, &TraitObject>(&self); - - // Prevent destructor on self being run - intrinsics::forget(self); - - // Extract the data pointer - Ok(mem::transmute(to.data)) - } - } else { - Err(self) - } - } -} diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index a37f9a516fd..87c4ef1046f 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -133,16 +133,13 @@ extern crate core; #[cfg(test)] pub use ops = realstd::ops; #[cfg(test)] pub use cmp = realstd::cmp; #[cfg(test)] pub use ty = realstd::ty; -#[cfg(not(stage0), test)] pub use owned = realstd::owned; +#[cfg(test)] pub use owned = realstd::owned; #[cfg(not(test))] pub use cmp = core::cmp; #[cfg(not(test))] pub use kinds = core::kinds; #[cfg(not(test))] pub use ops = core::ops; #[cfg(not(test))] pub use ty = core::ty; -#[cfg(stage0, test)] pub use owned = realstd::owned; -#[cfg(stage0, not(test))] pub use owned = core::owned; - pub use core::any; pub use core::bool; pub use core::cell; @@ -209,7 +206,7 @@ pub mod ascii; pub mod rc; pub mod gc; -#[cfg(not(stage0), not(test))] +#[cfg(not(test))] pub mod owned; /* Common traits */ diff --git a/src/snapshots.txt b/src/snapshots.txt index e88ae02c1c6..4c62d519d78 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,11 @@ +S 2014-05-15 6a2b3d1 + freebsd-x86_64 afc98b59cb819025fecdb9d145ca4463f857a477 + linux-i386 d6f7a404412ea34db3d19814ca21fe6fa662b02f + linux-x86_64 3dfb54406a7ea75565a7ea3071daad885cb91775 + macos-i386 bebb937551d601ad908c9e4eaa196cc7a977c503 + macos-x86_64 08346ed401ad2891c7d2ba0aac0960f6e77bb78b + winnt-i386 ad8e5b8292a00f60f1f7dc2e35bd18abeb5b858d + S 2014-05-11 72fc4a5 freebsd-x86_64 82db6355b0b7c8023c8845a74e2f224da2831b50 linux-i386 91901299d5f86f5b67377d940073908a1f0e4e82