diff options
| author | Валерий Лашманов <vflashm@gmail.com> | 2016-03-31 10:11:59 -0400 |
|---|---|---|
| committer | Валерий Лашманов <vflashm@gmail.com> | 2016-03-31 10:11:59 -0400 |
| commit | 33db2d65ffd5b988fdedc8ed91b395abaa57f777 (patch) | |
| tree | 5327b837607866485c43669a0667668598e0ef23 /src/libcore | |
| parent | 102a5be7126ef8f1e79086b98d1d9faf47ba8ece (diff) | |
| download | rust-33db2d65ffd5b988fdedc8ed91b395abaa57f777.tar.gz rust-33db2d65ffd5b988fdedc8ed91b395abaa57f777.zip | |
added missing refcell ref/refmut coercions to unsized
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/cell.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index fdd2e3a1784..aa02d982b52 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}; @@ -638,6 +638,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. @@ -770,6 +773,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 |
