#[experimental]
pub fn strong_count<T>(this: &Arc<T>) -> uint { this.inner().strong.load(atomic::SeqCst) }
-#[unstable = "waiting on stability of Clone"]
+#[stable]
impl<T> Clone for Arc<T> {
/// Makes a clone of the `Arc<T>`.
///
fn default() -> Box<[T]> { box [] }
}
-#[unstable]
+#[stable]
impl<T: Clone> Clone for Box<T> {
/// Returns a copy of the owned box.
#[inline]
}
}
-#[unstable = "Clone is unstable."]
+#[stable]
impl<T> Clone for Rc<T> {
/// Makes a clone of the `Rc<T>`.
///
}
}
+#[stable]
impl Clone for Bitv {
#[inline]
fn clone(&self) -> Bitv {
}
// FIXME(gereeter) Write an efficient clone_from
+#[stable]
impl<K: Clone, V: Clone> Clone for Node<K, V> {
fn clone(&self) -> Node<K, V> {
let mut ret = if self.is_leaf() {
}
}
+#[stable]
impl<A: Clone> Clone for DList<A> {
fn clone(&self) -> DList<A> {
self.iter().map(|x| x.clone()).collect()
ptr: *mut T
}
+#[stable]
impl<T: Clone> Clone for RingBuf<T> {
fn clone(&self) -> RingBuf<T> {
self.iter().map(|t| t.clone()).collect()
}
}
-#[unstable]
+#[stable]
impl<T:Clone> Clone for Vec<T> {
fn clone(&self) -> Vec<T> { self.as_slice().to_vec() }
macro_rules! array_impls {
($($N:expr)+) => {
$(
- #[unstable = "waiting for Clone to stabilize"]
+ #[stable]
impl<T:Copy> Clone for [T, ..$N] {
fn clone(&self) -> [T, ..$N] {
*self
20 21 22 23 24 25 26 27 28 29
30 31 32
}
-
Owned(T)
}
+#[stable]
impl<'a, T, Sized? B> Clone for Cow<'a, T, B> where B: ToOwned<T> {
fn clone(&self) -> Cow<'a, T, B> {
match *self {
}
}
-#[unstable = "waiting for `Clone` trait to become stable"]
+#[stable]
impl<T:Copy> Clone for Cell<T> {
fn clone(&self) -> Cell<T> {
Cell::new(self.get())
}
}
-#[unstable = "waiting for `Clone` to become stable"]
+#[stable]
impl<T: Clone> Clone for RefCell<T> {
fn clone(&self) -> RefCell<T> {
RefCell::new(self.borrow().clone())
//! explicitly, by convention implementing the `Clone` trait and calling
//! the `clone` method.
-#![unstable]
+#![stable]
use kinds::Sized;
/// A common trait for cloning an object.
+#[stable]
pub trait Clone {
/// Returns a copy of the value.
+ #[stable]
fn clone(&self) -> Self;
/// Perform copy-assignment from `source`.
/// but can be overridden to reuse the resources of `a` to avoid unnecessary
/// allocations.
#[inline(always)]
- #[experimental = "this function is mostly unused"]
+ #[unstable = "this function rarely unused"]
fn clone_from(&mut self, source: &Self) {
*self = source.clone()
}
}
+#[stable]
impl<'a, Sized? T> Clone for &'a T {
/// Return a shallow copy of the reference.
#[inline]
macro_rules! clone_impl {
($t:ty) => {
+ #[stable]
impl Clone for $t {
/// Return a deep copy of the value.
#[inline]
extern_fn_clone! { A, B, C, D, E, F }
extern_fn_clone! { A, B, C, D, E, F, G }
extern_fn_clone! { A, B, C, D, E, F, G, H }
-
}
}
+#[stable]
impl Clone for SipState {
#[inline]
fn clone(&self) -> SipState {
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, B, I, F> Clone for Map<A, B, I, F> where
I: Clone + Iterator<A>,
F: Clone + FnMut(A) -> B,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, I, P> Clone for Filter<A, I, P> where
I: Clone + Iterator<A>,
P: Clone + FnMut(&A) -> bool,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, B, I, F> Clone for FilterMap<A, B, I, F> where
I: Clone + Iterator<A>,
F: Clone + FnMut(A) -> Option<B>,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, I, P> Clone for SkipWhile<A, I, P> where
I: Clone + Iterator<A>,
P: Clone + FnMut(&A) -> bool,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, I, P> Clone for TakeWhile<A, I, P> where
I: Clone + Iterator<A>,
P: Clone + FnMut(&A) -> bool,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, B, I, St, F> Clone for Scan<A, B, I, St, F> where
I: Clone + Iterator<A>,
St: Clone,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, B, I, U, F> Clone for FlatMap<A, B, I, U, F> where
I: Clone + Iterator<A>,
U: Clone + Iterator<B>,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, I, F> Clone for Inspect<A, I, F> where
I: Clone + Iterator<A>,
F: Clone + FnMut(&A),
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<A, St, F> Clone for Unfold<A, St, F> where
F: Clone + FnMut(&mut St) -> Option<A>,
St: Clone,
impl<'a, A> ExactSizeIterator<&'a A> for Iter<'a, A> {}
+#[stable]
impl<'a, A> Clone for Iter<'a, A> {
fn clone(&self) -> Iter<'a, A> {
Iter { inner: self.inner.clone() }
}
}
+#[stable]
impl<T> Clone for *const T {
#[inline]
fn clone(&self) -> *const T {
}
}
+#[stable]
impl<T> Clone for *mut T {
#[inline]
fn clone(&self) -> *mut T {
#[inline]
fn ge(&self, other: &*mut T) -> bool { *self >= *other }
}
-
#[experimental = "needs review"]
impl<'a, T> ExactSizeIterator<&'a T> for Items<'a, T> {}
-#[experimental = "needs review"]
+#[stable]
impl<'a, T> Clone for Items<'a, T> {
fn clone(&self) -> Items<'a, T> { *self }
}
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
+#[stable]
impl<'a, T, P> Clone for Splits<'a, T, P> where P: Clone + FnMut(&T) -> bool {
fn clone(&self) -> Splits<'a, T, P> {
Splits {
impl_int_slice! { u32, i32 }
impl_int_slice! { u64, i64 }
impl_int_slice! { uint, int }
-
)+
}
- #[unstable = "waiting for Clone to stabilize"]
+ #[stable]
impl<$($T:Clone),+> Clone for ($($T,)+) {
fn clone(&self) -> ($($T,)+) {
($(e!(self.$idx.clone()),)+)
(val11, ref11, mut11, 11) -> L
}
}
-
}
}
-#[unstable]
+#[stable]
impl<T: Send> Clone for Sender<T> {
fn clone(&self) -> Sender<T> {
let (packet, sleeper, guard) = match *unsafe { self.inner() } {
}
}
-#[unstable]
+#[stable]
impl<T: Send> Clone for SyncSender<T> {
fn clone(&self) -> SyncSender<T> {
unsafe { (*self.inner.get()).clone_chan(); }
}
}
+#[stable]
impl Clone for ChanWriter {
fn clone(&self) -> ChanWriter {
ChanWriter { tx: self.tx.clone() }