提交 4a41c357 编写于 作者: R Ralf Jung

use strict provenance APIs

上级 4322a785
......@@ -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 @@ pub fn from_exposed_addr_mut<T>(addr: usize) -> *mut T
#[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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册