Rollup merge of #97764 - RalfJung:strict, r=dtolnay

use strict provenance APIs

The stdlib was adjusted to avoid bare int2ptr casts, but recently some casts of that sort have sneaked back in. Let's fix that. :)
This commit is contained in:
Matthias Krüger 2022-06-06 08:37:04 +02:00 committed by GitHub
commit 1bf1932453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -532,7 +532,7 @@ pub const fn null<T>() -> *const T {
#[rustc_diagnostic_item = "ptr_null"]
#[cfg(not(bootstrap))]
pub const fn null<T: ?Sized + Thin>() -> *const T {
from_raw_parts(0 as *const (), ())
from_raw_parts(invalid(0), ())
}
/// Creates a null mutable raw pointer.
@ -709,7 +709,7 @@ where
#[rustc_diagnostic_item = "ptr_null_mut"]
#[cfg(not(bootstrap))]
pub const fn null_mut<T: ?Sized + Thin>() -> *mut T {
from_raw_parts_mut(0 as *mut (), ())
from_raw_parts_mut(invalid_mut(0), ())
}
/// Forms a raw slice from a pointer and a length.