Skip to content

Commit f4c787d

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

File tree

52 files changed

+109
-104
lines changed

Some content is hidden

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

52 files changed

+109
-104
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 2 additions & 2 deletions
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
)

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 1 addition & 1 deletion
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,

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

Lines changed: 1 addition & 1 deletion
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
}

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 1 deletion
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,

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 1 addition & 1 deletion
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);

compiler/rustc_const_eval/src/interpret/cast.rs

Lines changed: 3 additions & 3 deletions
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>,

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

Lines changed: 1 addition & 1 deletion
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, _, _) => {

compiler/rustc_const_eval/src/transform/validate.rs

Lines changed: 1 addition & 1 deletion
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();

compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 1 addition & 1 deletion
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 => {

compiler/rustc_hir_typeck/messages.ftl

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)