Description
This issue is part of the Strict Provenance Experiment - #95228
I left a few little FIXME(strict_provenance_magic)
comments around core::ptr to indicate places that might want to become a compiler intrinsic for... Reasons. Currently all of these operations function but it's possible they can function "better" or somehow power better checking/analysis with builtin support.
In particular you probably want with_addr as some kind of instrinsic because the naive impl does a bunch of faffing around when on most platforms it's usize as *mut T
and on CHERI this is literally cheri_address_set.
rust/library/core/src/ptr/mut_ptr.rs
Lines 197 to 205 in bb5c437
This discussion is 100% "above my pay grade", I cannot provide any more insight.