Skip to content

Commit e9ef8e1

Browse files
authored
Rollup merge of #122935 - RalfJung:with-exposed-provenance, r=Amanieu
rename ptr::from_exposed_addr -> ptr::with_exposed_provenance As discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/To.20expose.20or.20not.20to.20expose/near/427757066). The old name, `from_exposed_addr`, makes little sense as it's not the address that is exposed, it's the provenance. (`ptr.expose_addr()` stays unchanged as we haven't found a better option yet. The intended interpretation is "expose the provenance and return the address".) The new name nicely matches `ptr::without_provenance`.
2 parents 0697ee9 + f2cff5e commit e9ef8e1

File tree

51 files changed

+120
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+120
-113
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22792279
}
22802280
}
22812281

2282-
CastKind::PointerFromExposedAddress => {
2282+
CastKind::PointerWithExposedProvenance => {
22832283
let ty_from = op.ty(body, tcx);
22842284
let cast_ty_from = CastTy::from_ty(ty_from);
22852285
let cast_ty_to = CastTy::from_ty(*ty);
@@ -2289,7 +2289,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22892289
span_mirbug!(
22902290
self,
22912291
rvalue,
2292-
"Invalid PointerFromExposedAddress cast {:?} -> {:?}",
2292+
"Invalid PointerWithExposedProvenance cast {:?} -> {:?}",
22932293
ty_from,
22942294
ty
22952295
)

compiler/rustc_codegen_cranelift/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ fn codegen_stmt<'tcx>(
650650
| CastKind::FnPtrToPtr
651651
| CastKind::PtrToPtr
652652
| CastKind::PointerExposeAddress
653-
| CastKind::PointerFromExposedAddress,
653+
| CastKind::PointerWithExposedProvenance,
654654
ref operand,
655655
to_ty,
656656
) => {

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
965965
});
966966
}
967967

968-
sym::simd_expose_addr | sym::simd_from_exposed_addr | sym::simd_cast_ptr => {
968+
sym::simd_expose_addr | sym::simd_with_exposed_provenance | sym::simd_cast_ptr => {
969969
intrinsic_args!(fx, args => (arg); intrinsic);
970970
ret.write_cvalue_transmute(fx, arg);
971971
}

compiler/rustc_codegen_llvm/src/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2139,7 +2139,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
21392139
return Ok(bx.ptrtoint(args[0].immediate(), llret_ty));
21402140
}
21412141

2142-
if name == sym::simd_from_exposed_addr {
2142+
if name == sym::simd_with_exposed_provenance {
21432143
let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn);
21442144
require!(
21452145
in_len == out_len,

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
509509
// Since int2ptr can have arbitrary integer types as input (so we have to do
510510
// sign extension and all that), it is currently best handled in the same code
511511
// path as the other integer-to-X casts.
512-
| mir::CastKind::PointerFromExposedAddress => {
512+
| mir::CastKind::PointerWithExposedProvenance => {
513513
assert!(bx.cx().is_backend_immediate(cast));
514514
let ll_t_out = bx.cx().immediate_backend_type(cast);
515515
if operand.layout.abi.is_uninhabited() {

compiler/rustc_const_eval/src/interpret/cast.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
4040
self.write_immediate(*res, dest)?;
4141
}
4242

43-
CastKind::PointerFromExposedAddress => {
43+
CastKind::PointerWithExposedProvenance => {
4444
let src = self.read_immediate(src)?;
45-
let res = self.pointer_from_exposed_address_cast(&src, cast_layout)?;
45+
let res = self.pointer_with_exposed_provenance_cast(&src, cast_layout)?;
4646
self.write_immediate(*res, dest)?;
4747
}
4848

@@ -242,7 +242,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
242242
Ok(ImmTy::from_scalar(self.cast_from_int_like(scalar, src.layout, cast_to.ty)?, cast_to))
243243
}
244244

245-
pub fn pointer_from_exposed_address_cast(
245+
pub fn pointer_with_exposed_provenance_cast(
246246
&self,
247247
src: &ImmTy<'tcx, M::Provenance>,
248248
cast_to: TyAndLayout<'tcx>,

compiler/rustc_const_eval/src/transform/check_consts/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
547547
Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => {
548548
self.check_op(ops::RawPtrToIntCast);
549549
}
550-
Rvalue::Cast(CastKind::PointerFromExposedAddress, _, _) => {
550+
Rvalue::Cast(CastKind::PointerWithExposedProvenance, _, _) => {
551551
// Since no pointer can ever get exposed (rejected above), this is easy to support.
552552
}
553553

compiler/rustc_const_eval/src/transform/validate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10761076
// FIXME(dyn-star): make sure nothing needs to be done here.
10771077
}
10781078
// FIXME: Add Checks for these
1079-
CastKind::PointerFromExposedAddress
1079+
CastKind::PointerWithExposedProvenance
10801080
| CastKind::PointerExposeAddress
10811081
| CastKind::PointerCoercion(_) => {}
10821082
CastKind::IntToInt | CastKind::IntToFloat => {

compiler/rustc_hir_analysis/src/check/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ pub fn check_intrinsic_type(
628628
| sym::simd_as
629629
| sym::simd_cast_ptr
630630
| sym::simd_expose_addr
631-
| sym::simd_from_exposed_addr => (2, 0, vec![param(0)], param(1)),
631+
| sym::simd_with_exposed_provenance => (2, 0, vec![param(0)], param(1)),
632632
sym::simd_bitmask => (2, 0, vec![param(0)], param(1)),
633633
sym::simd_select | sym::simd_select_bitmask => {
634634
(2, 0, vec![param(0), param(1), param(1)], param(1))

compiler/rustc_hir_typeck/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ hir_typeck_invalid_callee = expected function, found {$ty}
8686
hir_typeck_lossy_provenance_int2ptr =
8787
strict provenance disallows casting integer `{$expr_ty}` to pointer `{$cast_ty}`
8888
.suggestion = use `.with_addr()` to adjust a valid pointer in the same allocation, to this address
89-
.help = if you can't comply with strict provenance and don't have a pointer with the correct provenance you can use `std::ptr::from_exposed_addr()` instead
89+
.help = if you can't comply with strict provenance and don't have a pointer with the correct provenance you can use `std::ptr::with_exposed_provenance()` instead
9090
9191
hir_typeck_lossy_provenance_ptr2int =
9292
under strict provenance it is considered bad style to cast pointer `{$expr_ty}` to integer `{$cast_ty}`

compiler/rustc_lint_defs/src/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2749,19 +2749,19 @@ declare_lint! {
27492749
/// memory the pointer is allowed to read/write. Casting an integer, which
27502750
/// doesn't have provenance, to a pointer requires the compiler to assign
27512751
/// (guess) provenance. The compiler assigns "all exposed valid" (see the
2752-
/// docs of [`ptr::from_exposed_addr`] for more information about this
2752+
/// docs of [`ptr::with_exposed_provenance`] for more information about this
27532753
/// "exposing"). This penalizes the optimiser and is not well suited for
27542754
/// dynamic analysis/dynamic program verification (e.g. Miri or CHERI
27552755
/// platforms).
27562756
///
27572757
/// It is much better to use [`ptr::with_addr`] instead to specify the
27582758
/// provenance you want. If using this function is not possible because the
27592759
/// code relies on exposed provenance then there is as an escape hatch
2760-
/// [`ptr::from_exposed_addr`].
2760+
/// [`ptr::with_exposed_provenance`].
27612761
///
27622762
/// [issue #95228]: https://github.com/rust-lang/rust/issues/95228
27632763
/// [`ptr::with_addr`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.with_addr
2764-
/// [`ptr::from_exposed_addr`]: https://doc.rust-lang.org/core/ptr/fn.from_exposed_addr.html
2764+
/// [`ptr::with_exposed_provenance`]: https://doc.rust-lang.org/core/ptr/fn.with_exposed_provenance.html
27652765
pub FUZZY_PROVENANCE_CASTS,
27662766
Allow,
27672767
"a fuzzy integer to pointer cast is used",

compiler/rustc_middle/src/mir/statement.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl<'tcx> Rvalue<'tcx> {
426426
| CastKind::FnPtrToPtr
427427
| CastKind::PtrToPtr
428428
| CastKind::PointerCoercion(_)
429-
| CastKind::PointerFromExposedAddress
429+
| CastKind::PointerWithExposedProvenance
430430
| CastKind::DynStar
431431
| CastKind::Transmute,
432432
_,

compiler/rustc_middle/src/mir/syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1312,8 +1312,8 @@ pub enum CastKind {
13121312
/// See the docs on `expose_addr` for more details.
13131313
PointerExposeAddress,
13141314
/// An address-to-pointer cast that picks up an exposed provenance.
1315-
/// See the docs on `from_exposed_addr` for more details.
1316-
PointerFromExposedAddress,
1315+
/// See the docs on `with_exposed_provenance` for more details.
1316+
PointerWithExposedProvenance,
13171317
/// Pointer related casts that are done by coercions. Note that reference-to-raw-ptr casts are
13181318
/// translated into `&raw mut/const *r`, i.e., they are not actually casts.
13191319
PointerCoercion(PointerCoercion),

compiler/rustc_middle/src/ty/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn mir_cast_kind<'tcx>(from_ty: Ty<'tcx>, cast_ty: Ty<'tcx>) -> mir::CastKin
8585
(Some(CastTy::Ptr(_) | CastTy::FnPtr), Some(CastTy::Int(_))) => {
8686
mir::CastKind::PointerExposeAddress
8787
}
88-
(Some(CastTy::Int(_)), Some(CastTy::Ptr(_))) => mir::CastKind::PointerFromExposedAddress,
88+
(Some(CastTy::Int(_)), Some(CastTy::Ptr(_))) => mir::CastKind::PointerWithExposedProvenance,
8989
(_, Some(CastTy::DynStar)) => mir::CastKind::DynStar,
9090
(Some(CastTy::Int(_)), Some(CastTy::Int(_))) => mir::CastKind::IntToInt,
9191
(Some(CastTy::FnPtr), Some(CastTy::Ptr(_))) => mir::CastKind::FnPtrToPtr,

compiler/rustc_smir/src/rustc_smir/convert/mir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'tcx> Stable<'tcx> for mir::CastKind {
268268
use rustc_middle::mir::CastKind::*;
269269
match self {
270270
PointerExposeAddress => stable_mir::mir::CastKind::PointerExposeAddress,
271-
PointerFromExposedAddress => stable_mir::mir::CastKind::PointerFromExposedAddress,
271+
PointerWithExposedProvenance => stable_mir::mir::CastKind::PointerWithExposedProvenance,
272272
PointerCoercion(c) => stable_mir::mir::CastKind::PointerCoercion(c.stable(tables)),
273273
DynStar => stable_mir::mir::CastKind::DynStar,
274274
IntToInt => stable_mir::mir::CastKind::IntToInt,

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,6 @@ symbols! {
16751675
simd_fmin,
16761676
simd_fpow,
16771677
simd_fpowi,
1678-
simd_from_exposed_addr,
16791678
simd_fsin,
16801679
simd_fsqrt,
16811680
simd_gather,
@@ -1714,6 +1713,7 @@ symbols! {
17141713
simd_shuffle_generic,
17151714
simd_sub,
17161715
simd_trunc,
1716+
simd_with_exposed_provenance,
17171717
simd_xor,
17181718
since,
17191719
sinf128,

compiler/stable_mir/src/mir/body.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ pub enum PointerCoercion {
972972
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
973973
pub enum CastKind {
974974
PointerExposeAddress,
975-
PointerFromExposedAddress,
975+
PointerWithExposedProvenance,
976976
PointerCoercion(PointerCoercion),
977977
DynStar,
978978
IntToInt,

library/core/src/intrinsics/simd.rs

+7
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,10 @@ extern "rust-intrinsic" {
549549
///
550550
/// `U` must be a vector of pointers, with the same length as `T`.
551551
#[rustc_nounwind]
552+
#[cfg(not(bootstrap))]
553+
pub fn simd_with_exposed_provenance<T, U>(addr: T) -> U;
554+
#[rustc_nounwind]
555+
#[cfg(bootstrap)]
552556
pub fn simd_from_exposed_addr<T, U>(addr: T) -> U;
553557

554558
/// Swap bytes of each element.
@@ -655,3 +659,6 @@ extern "rust-intrinsic" {
655659
#[rustc_nounwind]
656660
pub fn simd_flog<T>(a: T) -> T;
657661
}
662+
663+
#[cfg(bootstrap)]
664+
pub use simd_from_exposed_addr as simd_with_exposed_provenance;

library/core/src/ptr/const_ptr.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<T: ?Sized> *const T {
165165
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
166166
#[deprecated(
167167
since = "1.67.0",
168-
note = "replaced by the `ptr::from_exposed_addr` function, or update \
168+
note = "replaced by the `ptr::with_exposed_provenance` function, or update \
169169
your code to follow the strict provenance rules using its APIs"
170170
)]
171171
#[allow(fuzzy_provenance_casts)] // this is an unstable and semi-deprecated cast function
@@ -187,7 +187,7 @@ impl<T: ?Sized> *const T {
187187
///
188188
/// If using those APIs is not possible because there is no way to preserve a pointer with the
189189
/// required provenance, then Strict Provenance might not be for you. Use pointer-integer casts
190-
/// or [`expose_addr`][pointer::expose_addr] and [`from_exposed_addr`][from_exposed_addr]
190+
/// or [`expose_addr`][pointer::expose_addr] and [`with_exposed_provenance`][with_exposed_provenance]
191191
/// instead. However, note that this makes your code less portable and less amenable to tools
192192
/// that check for compliance with the Rust memory model.
193193
///
@@ -211,30 +211,30 @@ impl<T: ?Sized> *const T {
211211
}
212212

213213
/// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
214-
/// use in [`from_exposed_addr`][].
214+
/// use in [`with_exposed_provenance`][].
215215
///
216216
/// This is equivalent to `self as usize`, which semantically discards *provenance* and
217217
/// *address-space* information. Furthermore, this (like the `as` cast) has the implicit
218218
/// side-effect of marking the provenance as 'exposed', so on platforms that support it you can
219-
/// later call [`from_exposed_addr`][] to reconstitute the original pointer including its
219+
/// later call [`with_exposed_provenance`][] to reconstitute the original pointer including its
220220
/// provenance. (Reconstructing address space information, if required, is your responsibility.)
221221
///
222222
/// Using this method means that code is *not* following [Strict
223223
/// Provenance][super#strict-provenance] rules. Supporting
224-
/// [`from_exposed_addr`][] complicates specification and reasoning and may not be supported by
224+
/// [`with_exposed_provenance`][] complicates specification and reasoning and may not be supported by
225225
/// tools that help you to stay conformant with the Rust memory model, so it is recommended to
226226
/// use [`addr`][pointer::addr] wherever possible.
227227
///
228228
/// On most platforms this will produce a value with the same bytes as the original pointer,
229229
/// because all the bytes are dedicated to describing the address. Platforms which need to store
230230
/// additional information in the pointer may not support this operation, since the 'expose'
231-
/// side-effect which is required for [`from_exposed_addr`][] to work is typically not
231+
/// side-effect which is required for [`with_exposed_provenance`][] to work is typically not
232232
/// available.
233233
///
234234
/// It is unclear whether this method can be given a satisfying unambiguous specification. This
235235
/// API and its claimed semantics are part of [Exposed Provenance][super#exposed-provenance].
236236
///
237-
/// [`from_exposed_addr`]: from_exposed_addr
237+
/// [`with_exposed_provenance`]: with_exposed_provenance
238238
#[must_use]
239239
#[inline(always)]
240240
#[unstable(feature = "exposed_provenance", issue = "95228")]

library/core/src/ptr/mod.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@
340340
//! clear where a satisfying unambiguous semantics can be defined for Exposed Provenance.
341341
//! Furthermore, Exposed Provenance will not work (well) with tools like [Miri] and [CHERI].
342342
//!
343-
//! Exposed Provenance is provided by the [`expose_addr`] and [`from_exposed_addr`] methods, which
343+
//! Exposed Provenance is provided by the [`expose_addr`] and [`with_exposed_provenance`] methods, which
344344
//! are meant to replace `as` casts between pointers and integers. [`expose_addr`] is a lot like
345345
//! [`addr`], but additionally adds the provenance of the pointer to a global list of 'exposed'
346346
//! provenances. (This list is purely conceptual, it exists for the purpose of specifying Rust but
347-
//! is not materialized in actual executions, except in tools like [Miri].) [`from_exposed_addr`]
347+
//! is not materialized in actual executions, except in tools like [Miri].) [`with_exposed_provenance`]
348348
//! can be used to construct a pointer with one of these previously 'exposed' provenances.
349-
//! [`from_exposed_addr`] takes only `addr: usize` as arguments, so unlike in [`with_addr`] there is
349+
//! [`with_exposed_provenance`] takes only `addr: usize` as arguments, so unlike in [`with_addr`] there is
350350
//! no indication of what the correct provenance for the returned pointer is -- and that is exactly
351351
//! what makes pointer-usize-pointer roundtrips so tricky to rigorously specify! There is no
352352
//! algorithm that decides which provenance will be used. You can think of this as "guessing" the
@@ -355,10 +355,10 @@
355355
//! there is *no* previously 'exposed' provenance that justifies the way the returned pointer will
356356
//! be used, the program has undefined behavior.
357357
//!
358-
//! Using [`expose_addr`] or [`from_exposed_addr`] (or the `as` casts) means that code is
358+
//! Using [`expose_addr`] or [`with_exposed_provenance`] (or the `as` casts) means that code is
359359
//! *not* following Strict Provenance rules. The goal of the Strict Provenance experiment is to
360360
//! determine how far one can get in Rust without the use of [`expose_addr`] and
361-
//! [`from_exposed_addr`], and to encourage code to be written with Strict Provenance APIs only.
361+
//! [`with_exposed_provenance`], and to encourage code to be written with Strict Provenance APIs only.
362362
//! Maximizing the amount of such code is a major win for avoiding specification complexity and to
363363
//! facilitate adoption of tools like [CHERI] and [Miri] that can be a big help in increasing the
364364
//! confidence in (unsafe) Rust code.
@@ -375,7 +375,7 @@
375375
//! [`addr`]: pointer::addr
376376
//! [`ptr::dangling`]: core::ptr::dangling
377377
//! [`expose_addr`]: pointer::expose_addr
378-
//! [`from_exposed_addr`]: from_exposed_addr
378+
//! [`with_exposed_provenance`]: with_exposed_provenance
379379
//! [Miri]: https://github.com/rust-lang/miri
380380
//! [CHERI]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
381381
//! [Strict Provenance]: https://github.com/rust-lang/rust/issues/95228
@@ -581,7 +581,7 @@ pub const fn null_mut<T: ?Sized + Thin>() -> *mut T {
581581
/// little more than a usize address in disguise.
582582
///
583583
/// This is different from `addr as *const T`, which creates a pointer that picks up a previously
584-
/// exposed provenance. See [`from_exposed_addr`] for more details on that operation.
584+
/// exposed provenance. See [`with_exposed_provenance`] for more details on that operation.
585585
///
586586
/// This API and its claimed semantics are part of the Strict Provenance experiment,
587587
/// see the [module documentation][crate::ptr] for details.
@@ -592,7 +592,7 @@ pub const fn null_mut<T: ?Sized + Thin>() -> *mut T {
592592
pub const fn without_provenance<T>(addr: usize) -> *const T {
593593
// FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
594594
// We use transmute rather than a cast so tools like Miri can tell that this
595-
// is *not* the same as from_exposed_addr.
595+
// is *not* the same as with_exposed_provenance.
596596
// SAFETY: every valid integer is also a valid pointer (as long as you don't dereference that
597597
// pointer).
598598
unsafe { mem::transmute(addr) }
@@ -625,7 +625,7 @@ pub const fn dangling<T>() -> *const T {
625625
/// little more than a usize address in disguise.
626626
///
627627
/// This is different from `addr as *mut T`, which creates a pointer that picks up a previously
628-
/// exposed provenance. See [`from_exposed_addr_mut`] for more details on that operation.
628+
/// exposed provenance. See [`with_exposed_provenance_mut`] for more details on that operation.
629629
///
630630
/// This API and its claimed semantics are part of the Strict Provenance experiment,
631631
/// see the [module documentation][crate::ptr] for details.
@@ -636,7 +636,7 @@ pub const fn dangling<T>() -> *const T {
636636
pub const fn without_provenance_mut<T>(addr: usize) -> *mut T {
637637
// FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
638638
// We use transmute rather than a cast so tools like Miri can tell that this
639-
// is *not* the same as from_exposed_addr.
639+
// is *not* the same as with_exposed_provenance.
640640
// SAFETY: every valid integer is also a valid pointer (as long as you don't dereference that
641641
// pointer).
642642
unsafe { mem::transmute(addr) }
@@ -699,7 +699,7 @@ pub const fn dangling_mut<T>() -> *mut T {
699699
#[unstable(feature = "exposed_provenance", issue = "95228")]
700700
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
701701
#[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead
702-
pub fn from_exposed_addr<T>(addr: usize) -> *const T
702+
pub fn with_exposed_provenance<T>(addr: usize) -> *const T
703703
where
704704
T: Sized,
705705
{
@@ -739,7 +739,7 @@ where
739739
#[unstable(feature = "exposed_provenance", issue = "95228")]
740740
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
741741
#[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead
742-
pub fn from_exposed_addr_mut<T>(addr: usize) -> *mut T
742+
pub fn with_exposed_provenance_mut<T>(addr: usize) -> *mut T
743743
where
744744
T: Sized,
745745
{

0 commit comments

Comments
 (0)