core/intrinsics/
bounds.rs
1use crate::marker::PointeeSized;
4
5pub unsafe trait BuiltinDeref: Sized {
11 type Pointee: PointeeSized;
12}
13
14unsafe impl<T: PointeeSized> BuiltinDeref for &mut T {
15 type Pointee = T;
16}
17unsafe impl<T: PointeeSized> BuiltinDeref for &T {
18 type Pointee = T;
19}
20unsafe impl<T: PointeeSized> BuiltinDeref for *mut T {
21 type Pointee = T;
22}
23unsafe impl<T: PointeeSized> BuiltinDeref for *const T {
24 type Pointee = T;
25}
26
27#[cfg(not(feature = "ferrocene_certified"))]
28pub trait ChangePointee<U: PointeeSized>: BuiltinDeref {
29 type Output;
30}
31#[cfg(not(feature = "ferrocene_certified"))]
32impl<'a, T: PointeeSized + 'a, U: PointeeSized + 'a> ChangePointee<U> for &'a mut T {
33 type Output = &'a mut U;
34}
35#[cfg(not(feature = "ferrocene_certified"))]
36impl<'a, T: PointeeSized + 'a, U: PointeeSized + 'a> ChangePointee<U> for &'a T {
37 type Output = &'a U;
38}
39#[cfg(not(feature = "ferrocene_certified"))]
40impl<T: PointeeSized, U: PointeeSized> ChangePointee<U> for *mut T {
41 type Output = *mut U;
42}
43#[cfg(not(feature = "ferrocene_certified"))]
44impl<T: PointeeSized, U: PointeeSized> ChangePointee<U> for *const T {
45 type Output = *const U;
46}