about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/cell.rs10
-rw-r--r--src/libcore/sync/atomic.rs2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index 4a9a1485063..b2cbc29b1c7 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -147,8 +147,8 @@
 use clone::Clone;
 use cmp::{PartialEq, Eq};
 use default::Default;
-use marker::{Copy, Send, Sync, Sized};
-use ops::{Deref, DerefMut, Drop, FnOnce};
+use marker::{Copy, Send, Sync, Sized, Unsize};
+use ops::{Deref, DerefMut, Drop, FnOnce, CoerceUnsized};
 use option::Option;
 use option::Option::{None, Some};
 
@@ -634,6 +634,9 @@ impl<'b, T: ?Sized> Ref<'b, T> {
     }
 }
 
+#[unstable(feature = "coerce_unsized", issue = "27732")]
+impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b, T> {}
+
 impl<'b, T: ?Sized> RefMut<'b, T> {
     /// Make a new `RefMut` for a component of the borrowed data, e.g. an enum
     /// variant.
@@ -766,6 +769,9 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
     }
 }
 
+#[unstable(feature = "coerce_unsized", issue = "27732")]
+impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefMut<'b, T> {}
+
 /// The core primitive for interior mutability in Rust.
 ///
 /// `UnsafeCell<T>` is a type that wraps some `T` and indicates unsafe interior operations on the
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index 7ae129eaf48..d2e98a795d9 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -695,7 +695,7 @@ impl AtomicIsize {
         unsafe { atomic_compare_exchange(self.v.get(), current, new, success, failure) }
     }
 
-    /// Stores a value into the `isize if the current value is the same as the `current` value.
+    /// Stores a value into the `isize` if the current value is the same as the `current` value.
     ///
     /// Unlike `compare_exchange`, this function is allowed to spuriously fail even when the
     /// comparison succeeds, which can result in more efficient code on some platforms. The