core/intrinsics/
bounds.rs1pub unsafe trait BuiltinDeref: Sized {
9 type Pointee: ?Sized;
10}
11
12unsafe impl<T: ?Sized> BuiltinDeref for &mut T {
13 type Pointee = T;
14}
15unsafe impl<T: ?Sized> BuiltinDeref for &T {
16 type Pointee = T;
17}
18unsafe impl<T: ?Sized> BuiltinDeref for *mut T {
19 type Pointee = T;
20}
21unsafe impl<T: ?Sized> BuiltinDeref for *const T {
22 type Pointee = T;
23}
24
25pub trait ChangePointee<U: ?Sized>: BuiltinDeref {
26 type Output;
27}
28impl<'a, T: ?Sized + 'a, U: ?Sized + 'a> ChangePointee<U> for &'a mut T {
29 type Output = &'a mut U;
30}
31impl<'a, T: ?Sized + 'a, U: ?Sized + 'a> ChangePointee<U> for &'a T {
32 type Output = &'a U;
33}
34impl<T: ?Sized, U: ?Sized> ChangePointee<U> for *mut T {
35 type Output = *mut U;
36}
37impl<T: ?Sized, U: ?Sized> ChangePointee<U> for *const T {
38 type Output = *const U;
39}