File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,9 @@ impl<T: ?Sized> *const T {
180180 T : Sized ,
181181 {
182182 // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
183- self as usize
183+ // SAFETY: Pointer-to-integer transmutes are valid (if you are okay with losing the
184+ // provenance).
185+ unsafe { mem:: transmute ( self ) }
184186 }
185187
186188 /// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
Original file line number Diff line number Diff line change @@ -184,7 +184,9 @@ impl<T: ?Sized> *mut T {
184184 T : Sized ,
185185 {
186186 // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
187- self as usize
187+ // SAFETY: Pointer-to-integer transmutes are valid (if you are okay with losing the
188+ // provenance).
189+ unsafe { mem:: transmute ( self ) }
188190 }
189191
190192 /// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
You can’t perform that action at this time.
0 commit comments