Skip to content

Commit b12ab29

Browse files
committed
rename expose_addr to expose
1 parent 020bbe4 commit b12ab29

File tree

44 files changed

+94
-89
lines changed

Some content is hidden

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

44 files changed

+94
-89
lines changed

Diff for: compiler/rustc_borrowck/src/type_check/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22452245
}
22462246
}
22472247

2248-
CastKind::PointerExposeAddress => {
2248+
CastKind::PointerExpose => {
22492249
let ty_from = op.ty(body, tcx);
22502250
let cast_ty_from = CastTy::from_ty(ty_from);
22512251
let cast_ty_to = CastTy::from_ty(*ty);
@@ -2255,7 +2255,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22552255
span_mirbug!(
22562256
self,
22572257
rvalue,
2258-
"Invalid PointerExposeAddress cast {:?} -> {:?}",
2258+
"Invalid PointerExpose cast {:?} -> {:?}",
22592259
ty_from,
22602260
ty
22612261
)

Diff for: compiler/rustc_codegen_cranelift/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ fn codegen_stmt<'tcx>(
641641
| CastKind::IntToFloat
642642
| CastKind::FnPtrToPtr
643643
| CastKind::PtrToPtr
644-
| CastKind::PointerExposeAddress
644+
| CastKind::PointerExpose
645645
| CastKind::PointerFromExposedAddress,
646646
ref operand,
647647
to_ty,

Diff for: 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 | sym::simd_from_exposed_addr | sym::simd_cast_ptr => {
969969
intrinsic_args!(fx, args => (arg); intrinsic);
970970
ret.write_cvalue_transmute(fx, arg);
971971
}

Diff for: compiler/rustc_codegen_llvm/src/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
21052105
return Ok(args[0].immediate());
21062106
}
21072107

2108-
if name == sym::simd_expose_addr {
2108+
if name == sym::simd_expose {
21092109
let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn);
21102110
require!(
21112111
in_len == out_len,

Diff for: compiler/rustc_codegen_ssa/src/mir/rvalue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
404404
let cast = bx.cx().layout_of(self.monomorphize(mir_cast_ty));
405405

406406
let val = match *kind {
407-
mir::CastKind::PointerExposeAddress => {
407+
mir::CastKind::PointerExpose => {
408408
assert!(bx.cx().is_backend_immediate(cast));
409409
let llptr = operand.immediate();
410410
let llcast_ty = bx.cx().immediate_backend_type(cast);

Diff for: compiler/rustc_const_eval/src/interpret/cast.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
3434
self.unsize_into(src, cast_layout, dest)?;
3535
}
3636

37-
CastKind::PointerExposeAddress => {
37+
CastKind::PointerExpose => {
3838
let src = self.read_immediate(src)?;
39-
let res = self.pointer_expose_address_cast(&src, cast_layout)?;
39+
let res = self.pointer_expose_cast(&src, cast_layout)?;
4040
self.write_immediate(*res, dest)?;
4141
}
4242

@@ -225,7 +225,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
225225
}
226226
}
227227

228-
pub fn pointer_expose_address_cast(
228+
pub fn pointer_expose_cast(
229229
&mut self,
230230
src: &ImmTy<'tcx, M::Provenance>,
231231
cast_to: TyAndLayout<'tcx>,

Diff for: compiler/rustc_const_eval/src/transform/check_consts/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
544544
// Unsizing is implemented for CTFE.
545545
}
546546

547-
Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => {
547+
Rvalue::Cast(CastKind::PointerExpose, _, _) => {
548548
self.check_op(ops::RawPtrToIntCast);
549549
}
550550
Rvalue::Cast(CastKind::PointerFromExposedAddress, _, _) => {

Diff for: compiler/rustc_const_eval/src/transform/validate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10581058
}
10591059
// FIXME: Add Checks for these
10601060
CastKind::PointerFromExposedAddress
1061-
| CastKind::PointerExposeAddress
1061+
| CastKind::PointerExpose
10621062
| CastKind::PointerCoercion(_) => {}
10631063
CastKind::IntToInt | CastKind::IntToFloat => {
10641064
let input_valid = op_ty.is_integral() || op_ty.is_char() || op_ty.is_bool();

Diff for: compiler/rustc_hir_analysis/src/check/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ pub fn check_intrinsic_type(
624624
sym::simd_cast
625625
| sym::simd_as
626626
| sym::simd_cast_ptr
627-
| sym::simd_expose_addr
627+
| sym::simd_expose
628628
| sym::simd_from_exposed_addr => (2, 0, vec![param(0)], param(1)),
629629
sym::simd_bitmask => (2, 0, vec![param(0)], param(1)),
630630
sym::simd_select | sym::simd_select_bitmask => {

Diff for: compiler/rustc_hir_typeck/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ hir_typeck_lossy_provenance_int2ptr =
9191
hir_typeck_lossy_provenance_ptr2int =
9292
under strict provenance it is considered bad style to cast pointer `{$expr_ty}` to integer `{$cast_ty}`
9393
.suggestion = use `.addr()` to obtain the address of a pointer
94-
.help = if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
94+
.help = if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose()` instead
9595
9696
hir_typeck_method_call_on_unknown_raw_pointee =
9797
cannot call a method on a raw pointer with an unknown pointee type

Diff for: compiler/rustc_lint_defs/src/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2797,17 +2797,17 @@ declare_lint! {
27972797
/// Since this cast is lossy, it is considered good style to use the
27982798
/// [`ptr::addr`] method instead, which has a similar effect, but doesn't
27992799
/// "expose" the pointer provenance. This improves optimisation potential.
2800-
/// See the docs of [`ptr::addr`] and [`ptr::expose_addr`] for more information
2800+
/// See the docs of [`ptr::addr`] and [`ptr::expose`] for more information
28012801
/// about exposing pointer provenance.
28022802
///
28032803
/// If your code can't comply with strict provenance and needs to expose
2804-
/// the provenance, then there is [`ptr::expose_addr`] as an escape hatch,
2804+
/// the provenance, then there is [`ptr::expose`] as an escape hatch,
28052805
/// which preserves the behaviour of `as usize` casts while being explicit
28062806
/// about the semantics.
28072807
///
28082808
/// [issue #95228]: https://github.com/rust-lang/rust/issues/95228
28092809
/// [`ptr::addr`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.addr
2810-
/// [`ptr::expose_addr`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.expose_addr
2810+
/// [`ptr::expose`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.expose
28112811
pub LOSSY_PROVENANCE_CASTS,
28122812
Allow,
28132813
"a lossy pointer to integer cast is used",

Diff for: compiler/rustc_middle/src/mir/statement.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ impl<'tcx> Rvalue<'tcx> {
409409
// Pointer to int casts may be side-effects due to exposing the provenance.
410410
// While the model is undecided, we should be conservative. See
411411
// <https://www.ralfj.de/blog/2022/04/11/provenance-exposed.html>
412-
Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => false,
412+
Rvalue::Cast(CastKind::PointerExpose, _, _) => false,
413413

414414
Rvalue::Use(_)
415415
| Rvalue::CopyForDeref(_)

Diff for: compiler/rustc_middle/src/mir/syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1315,8 +1315,8 @@ pub enum Rvalue<'tcx> {
13151315
pub enum CastKind {
13161316
/// An exposing pointer to address cast. A cast between a pointer and an integer type, or
13171317
/// between a function pointer and an integer type.
1318-
/// See the docs on `expose_addr` for more details.
1319-
PointerExposeAddress,
1318+
/// See the docs on `expose` for more details.
1319+
PointerExpose,
13201320
/// An address-to-pointer cast that picks up an exposed provenance.
13211321
/// See the docs on `from_exposed_addr` for more details.
13221322
PointerFromExposedAddress,

Diff for: compiler/rustc_middle/src/ty/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn mir_cast_kind<'tcx>(from_ty: Ty<'tcx>, cast_ty: Ty<'tcx>) -> mir::CastKin
8383
let cast = CastTy::from_ty(cast_ty);
8484
let cast_kind = match (from, cast) {
8585
(Some(CastTy::Ptr(_) | CastTy::FnPtr), Some(CastTy::Int(_))) => {
86-
mir::CastKind::PointerExposeAddress
86+
mir::CastKind::PointerExpose
8787
}
8888
(Some(CastTy::Int(_)), Some(CastTy::Ptr(_))) => mir::CastKind::PointerFromExposedAddress,
8989
(_, Some(CastTy::DynStar)) => mir::CastKind::DynStar,

Diff for: compiler/rustc_mir_transform/src/promote_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ impl<'tcx> Validator<'_, 'tcx> {
434434
Rvalue::ThreadLocalRef(_) => return Err(Unpromotable),
435435

436436
// ptr-to-int casts are not possible in consts and thus not promotable
437-
Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => return Err(Unpromotable),
437+
Rvalue::Cast(CastKind::PointerExpose, _, _) => return Err(Unpromotable),
438438

439439
// all other casts including int-to-ptr casts are fine, they just use the integer value
440440
// at pointer type.

Diff for: compiler/rustc_mir_transform/src/shim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ fn build_fn_ptr_addr_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'t
985985
let locals = local_decls_for_sig(&sig, span);
986986

987987
let source_info = SourceInfo::outermost(span);
988-
// FIXME: use `expose_addr` once we figure out whether function pointers have meaningful provenance.
988+
// FIXME: use `expose` once we figure out whether function pointers have meaningful provenance.
989989
let rvalue = Rvalue::Cast(
990990
CastKind::FnPtrToPtr,
991991
Operand::Move(Place::from(Local::new(1))),

Diff for: compiler/rustc_smir/src/rustc_smir/convert/mir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl<'tcx> Stable<'tcx> for mir::CastKind {
273273
fn stable(&self, tables: &mut Tables<'_>) -> Self::T {
274274
use rustc_middle::mir::CastKind::*;
275275
match self {
276-
PointerExposeAddress => stable_mir::mir::CastKind::PointerExposeAddress,
276+
PointerExpose => stable_mir::mir::CastKind::PointerExpose,
277277
PointerFromExposedAddress => stable_mir::mir::CastKind::PointerFromExposedAddress,
278278
PointerCoercion(c) => stable_mir::mir::CastKind::PointerCoercion(c.stable(tables)),
279279
DynStar => stable_mir::mir::CastKind::DynStar,

Diff for: compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ symbols! {
16331633
simd_cttz,
16341634
simd_div,
16351635
simd_eq,
1636-
simd_expose_addr,
1636+
simd_expose,
16371637
simd_extract,
16381638
simd_fabs,
16391639
simd_fcos,

Diff for: compiler/stable_mir/src/mir/body.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ pub enum PointerCoercion {
967967

968968
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
969969
pub enum CastKind {
970-
PointerExposeAddress,
970+
PointerExpose,
971971
PointerFromExposedAddress,
972972
PointerCoercion(PointerCoercion),
973973
DynStar,

Diff for: library/core/src/fmt/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2434,8 +2434,8 @@ impl Display for char {
24342434
#[stable(feature = "rust1", since = "1.0.0")]
24352435
impl<T: ?Sized> Pointer for *const T {
24362436
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2437-
// Cast is needed here because `.expose_addr()` requires `T: Sized`.
2438-
pointer_fmt_inner((*self as *const ()).expose_addr(), f)
2437+
// Cast is needed here because `.expose()` requires `T: Sized`.
2438+
pointer_fmt_inner((*self as *const ()).expose(), f)
24392439
}
24402440
}
24412441

Diff for: library/core/src/intrinsics/simd.rs

+7
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ extern "rust-intrinsic" {
540540
/// `T` must be a vector of pointers.
541541
///
542542
/// `U` must be a vector of `usize` with the same length as `T`.
543+
#[cfg(not(bootstrap))]
544+
#[rustc_nounwind]
545+
pub fn simd_expose<T, U>(ptr: T) -> U;
546+
#[cfg(bootstrap)]
543547
#[rustc_nounwind]
544548
pub fn simd_expose_addr<T, U>(ptr: T) -> U;
545549

@@ -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_expose_addr as simd_expose;

Diff for: library/core/src/ptr/const_ptr.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<T: ?Sized> *const T {
136136
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
137137
#[deprecated(
138138
since = "1.67.0",
139-
note = "replaced by the `expose_addr` method, or update your code \
139+
note = "replaced by the `expose` method, or update your code \
140140
to follow the strict provenance rules using its APIs"
141141
)]
142142
#[inline(always)]
@@ -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`][pointer::expose] and [`from_exposed_addr`][from_exposed_addr]
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
///
@@ -210,8 +210,8 @@ impl<T: ?Sized> *const T {
210210
unsafe { mem::transmute(self.cast::<()>()) }
211211
}
212212

213-
/// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
214-
/// use in [`from_exposed_addr`][].
213+
/// Exposes the "provenance" part of the pointer for future use in
214+
/// [`from_exposed_addr`][] and returns the "address" portion.
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
@@ -235,10 +235,9 @@ impl<T: ?Sized> *const T {
235235
/// API and its claimed semantics are part of [Exposed Provenance][super#exposed-provenance].
236236
///
237237
/// [`from_exposed_addr`]: from_exposed_addr
238-
#[must_use]
239238
#[inline(always)]
240239
#[unstable(feature = "exposed_provenance", issue = "95228")]
241-
pub fn expose_addr(self) -> usize {
240+
pub fn expose(self) -> usize {
242241
// FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
243242
self.cast::<()>() as usize
244243
}

Diff for: library/core/src/ptr/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@
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
344-
//! are meant to replace `as` casts between pointers and integers. [`expose_addr`] is a lot like
343+
//! Exposed Provenance is provided by the [`expose`] and [`from_exposed_addr`] methods, which
344+
//! are meant to replace `as` casts between pointers and integers. [`expose`] 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
347347
//! is not materialized in actual executions, except in tools like [Miri].) [`from_exposed_addr`]
@@ -355,9 +355,9 @@
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`] or [`from_exposed_addr`] (or the `as` casts) means that code is
359359
//! *not* following Strict Provenance rules. The goal of the Strict Provenance experiment is to
360-
//! determine how far one can get in Rust without the use of [`expose_addr`] and
360+
//! determine how far one can get in Rust without the use of [`expose`] and
361361
//! [`from_exposed_addr`], 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
@@ -374,7 +374,7 @@
374374
//! [`map_addr`]: pointer::map_addr
375375
//! [`addr`]: pointer::addr
376376
//! [`ptr::dangling`]: core::ptr::dangling
377-
//! [`expose_addr`]: pointer::expose_addr
377+
//! [`expose`]: pointer::expose
378378
//! [`from_exposed_addr`]: from_exposed_addr
379379
//! [Miri]: https://github.com/rust-lang/miri
380380
//! [CHERI]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
@@ -664,7 +664,7 @@ pub const fn dangling_mut<T>() -> *mut T {
664664
///
665665
/// This is a more rigorously specified alternative to `addr as *const T`. The provenance of the
666666
/// returned pointer is that of *any* pointer that was previously exposed by passing it to
667-
/// [`expose_addr`][pointer::expose_addr], or a `ptr as usize` cast. In addition, memory which is
667+
/// [`expose`][pointer::expose], or a `ptr as usize` cast. In addition, memory which is
668668
/// outside the control of the Rust abstract machine (MMIO registers, for example) is always
669669
/// considered to be exposed, so long as this memory is disjoint from memory that will be used by
670670
/// the abstract machine such as the stack, heap, and statics.
@@ -712,7 +712,7 @@ where
712712
///
713713
/// This is a more rigorously specified alternative to `addr as *mut T`. The provenance of the
714714
/// returned pointer is that of *any* pointer that was previously passed to
715-
/// [`expose_addr`][pointer::expose_addr] or a `ptr as usize` cast. If there is no previously
715+
/// [`expose`][pointer::expose] or a `ptr as usize` cast. If there is no previously
716716
/// 'exposed' provenance that justifies the way this pointer will be used, the program has undefined
717717
/// behavior. Note that there is no algorithm that decides which provenance will be used. You can
718718
/// think of this as "guessing" the right provenance, and the guess will be "maximally in your

Diff for: library/core/src/ptr/mut_ptr.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl<T: ?Sized> *mut T {
142142
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
143143
#[deprecated(
144144
since = "1.67.0",
145-
note = "replaced by the `expose_addr` method, or update your code \
145+
note = "replaced by the `expose` method, or update your code \
146146
to follow the strict provenance rules using its APIs"
147147
)]
148148
#[inline(always)]
@@ -194,7 +194,7 @@ impl<T: ?Sized> *mut T {
194194
///
195195
/// If using those APIs is not possible because there is no way to preserve a pointer with the
196196
/// required provenance, then Strict Provenance might not be for you. Use pointer-integer casts
197-
/// or [`expose_addr`][pointer::expose_addr] and [`from_exposed_addr`][from_exposed_addr]
197+
/// or [`expose`][pointer::expose] and [`from_exposed_addr`][from_exposed_addr]
198198
/// instead. However, note that this makes your code less portable and less amenable to tools
199199
/// that check for compliance with the Rust memory model.
200200
///
@@ -217,8 +217,8 @@ impl<T: ?Sized> *mut T {
217217
unsafe { mem::transmute(self.cast::<()>()) }
218218
}
219219

220-
/// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
221-
/// use in [`from_exposed_addr`][].
220+
/// Exposes the "provenance" part of the pointer for future use in
221+
/// [`from_exposed_addr`][] and returns the "address" portion.
222222
///
223223
/// This is equivalent to `self as usize`, which semantically discards *provenance* and
224224
/// *address-space* information. Furthermore, this (like the `as` cast) has the implicit
@@ -242,10 +242,9 @@ impl<T: ?Sized> *mut T {
242242
/// API and its claimed semantics are part of [Exposed Provenance][super#exposed-provenance].
243243
///
244244
/// [`from_exposed_addr_mut`]: from_exposed_addr_mut
245-
#[must_use]
246245
#[inline(always)]
247246
#[unstable(feature = "exposed_provenance", issue = "95228")]
248-
pub fn expose_addr(self) -> usize {
247+
pub fn expose(self) -> usize {
249248
// FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
250249
self.cast::<()>() as usize
251250
}

Diff for: library/portable-simd/crates/core_simd/src/simd/ptr/const_ptr.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ pub trait SimdConstPtr: Copy + Sealed {
5050
/// Equivalent to calling [`pointer::with_addr`] on each element.
5151
fn with_addr(self, addr: Self::Usize) -> Self;
5252

53-
/// Gets the "address" portion of the pointer, and "exposes" the provenance part for future use
54-
/// in [`Self::from_exposed_addr`].
55-
fn expose_addr(self) -> Self::Usize;
53+
/// Exposes the "provenance" part of the pointer for future use in
54+
/// [`Self::from_exposed_addr`] and returns the "address" portion.
55+
fn expose(self) -> Self::Usize;
5656

5757
/// Convert an address back to a pointer, picking up a previously "exposed" provenance.
5858
///
@@ -131,9 +131,9 @@ where
131131
}
132132

133133
#[inline]
134-
fn expose_addr(self) -> Self::Usize {
134+
fn expose(self) -> Self::Usize {
135135
// Safety: `self` is a pointer vector
136-
unsafe { core::intrinsics::simd::simd_expose_addr(self) }
136+
unsafe { core::intrinsics::simd::simd_expose(self) }
137137
}
138138

139139
#[inline]

0 commit comments

Comments
 (0)