File tree 2 files changed +6
-2
lines changed
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 {
180
180
T : Sized ,
181
181
{
182
182
// 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 ) }
184
186
}
185
187
186
188
/// 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 {
184
184
T : Sized ,
185
185
{
186
186
// 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 ) }
188
190
}
189
191
190
192
/// 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