diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-05-08 15:03:39 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-05-08 16:00:49 -0400 |
| commit | 044abef0e56f02c36cf93fd9572813c2b27f98af (patch) | |
| tree | b804895f5d40c57f3ea707368773cbc0e230c5a6 /src/libcore | |
| parent | b21f37c81804293168424697518d306542cdd798 (diff) | |
| download | rust-044abef0e56f02c36cf93fd9572813c2b27f98af.tar.gz rust-044abef0e56f02c36cf93fd9572813c2b27f98af.zip | |
fix incorrect region code based on the old 'self
also removes unnecessary casts from the RcMut implementation
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/cast.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/cast.rs b/src/libcore/cast.rs index 96e1c3bd124..c648ec198e1 100644 --- a/src/libcore/cast.rs +++ b/src/libcore/cast.rs @@ -110,6 +110,12 @@ pub unsafe fn copy_lifetime<'a,S,T>(_ptr: &'a S, ptr: &T) -> &'a T { /// Transforms lifetime of the second pointer to match the first. #[inline(always)] +pub unsafe fn copy_mut_lifetime<'a,S,T>(_ptr: &'a mut S, ptr: &mut T) -> &'a mut T { + transmute_mut_region(ptr) +} + +/// Transforms lifetime of the second pointer to match the first. +#[inline(always)] pub unsafe fn copy_lifetime_vec<'a,S,T>(_ptr: &'a [S], ptr: &T) -> &'a T { transmute_region(ptr) } |
