fn shift_mut_ref<'a, T>(r: &mut &'a mut [T]) -> Option<&'a mut T> {
    use std::mem;
    use std::raw::Repr;

    if r.len() == 0 { return None }
    unsafe {
        let mut raw = r.repr();
        let ret = raw.data as *mut T;
        raw.data = raw.data.offset(1);
        raw.len -= 1;
        *r = mem::transmute(raw);
        Some(unsafe { &mut *ret })
    }
}
/// Pop a mutable reference off the head of a slice, mutating the slice to no
/// longer contain the mutable reference. This is a safe operation because the
/// two mutable borrows are entirely disjoint.
Pop a mutable reference off the head of a slice, mutating the slice to no
longer contain the mutable reference. This is a safe operation because the
two mutable borrows are entirely disjoint.
Pop a mutable reference off the head of a slice mutating the slice to no longer contain the mutable reference . This is a safe operation because the two mutable borrows are entirely disjoint .
fn shift_mut_ref<'a, T>(r: &mut &'a mut [T]) -> Option<&'a mut T> {
    use std::mem;
    use std::raw::Repr;
    if r.len() == 0 { return None }
    unsafe {
        let mut raw = r.repr();
        let ret = raw.data as *mut T;
        raw.data = raw.data.offset(1);
        raw.len -= 1;
        *r = mem::transmute(raw);
        Some(unsafe { &mut *ret })
    }
}
fn shift_mut_ref < ' a , T > ( r : & mut & ' a mut [ T ] ) -> Option < & ' a mut T > { use std :: mem ; use std :: raw :: Repr ; if r . len ( ) == 0 { return None } unsafe { let mut raw = r . repr ( ) ; let ret = raw . data as * mut T ; raw . data = raw . data . offset ( 1 ) ; raw . len -= 1 ; * r = mem :: transmute ( raw ) ; Some ( unsafe { & mut * ret } ) } }
Pop a mutable reference off the head of a slice, mutating the slice to no
longer contain the mutable reference.
Pop a mutable reference off the head of a slice mutating the slice to no longer contain the mutable reference .
r
&mut &'a mut [T]
r
&mut &'a mut [T]