Skip to content

Commit b916431

Browse files
Rename struct_tail_erasing_lifetimes to struct_tail_for_codegen
1 parent f81549c commit b916431

File tree

17 files changed

+24
-29
lines changed

17 files changed

+24
-29
lines changed

compiler/rustc_codegen_cranelift/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub(crate) fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
107107
return false;
108108
}
109109

110-
let tail = tcx.struct_tail_erasing_lifetimes(ty, ParamEnv::reveal_all());
110+
let tail = tcx.struct_tail_for_codegen(ty, ParamEnv::reveal_all());
111111
match tail.kind() {
112112
ty::Foreign(..) => false,
113113
ty::Str | ty::Slice(..) | ty::Dynamic(..) => true,

compiler/rustc_codegen_cranelift/src/unsize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(crate) fn unsized_info<'tcx>(
2222
old_info: Option<Value>,
2323
) -> Value {
2424
let (source, target) =
25-
fx.tcx.struct_lockstep_tails_erasing_lifetimes(source, target, ParamEnv::reveal_all());
25+
fx.tcx.struct_lockstep_tails_for_codegen(source, target, ParamEnv::reveal_all());
2626
match (&source.kind(), &target.kind()) {
2727
(&ty::Array(_, len), &ty::Slice(_)) => fx
2828
.bcx

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
532532
#[instrument(level = "trace", skip(self))]
533533
fn load_operand(&mut self, place: PlaceRef<'tcx, &'ll Value>) -> OperandRef<'tcx, &'ll Value> {
534534
if place.layout.is_unsized() {
535-
let tail = self.tcx.struct_tail_erasing_lifetimes(place.layout.ty, self.param_env());
535+
let tail = self.tcx.struct_tail_for_codegen(place.layout.ty, self.param_env());
536536
if matches!(tail.kind(), ty::Foreign(..)) {
537537
// Unsized locals and, at least conceptually, even unsized arguments must be copied
538538
// around, which requires dynamically determining their size. Therefore, we cannot

compiler/rustc_codegen_llvm/src/debuginfo/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub(crate) fn fat_pointer_kind<'ll, 'tcx>(
6262
cx: &CodegenCx<'ll, 'tcx>,
6363
pointee_ty: Ty<'tcx>,
6464
) -> Option<FatPtrKind> {
65-
let pointee_tail_ty = cx.tcx.struct_tail_erasing_lifetimes(pointee_ty, cx.param_env());
65+
let pointee_tail_ty = cx.tcx.struct_tail_for_codegen(pointee_ty, cx.param_env());
6666
let layout = cx.layout_of(pointee_tail_ty);
6767
trace!(
6868
"fat_pointer_kind: {:?} has layout {:?} (is_unsized? {})",

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub fn unsized_info<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
143143
) -> Bx::Value {
144144
let cx = bx.cx();
145145
let (source, target) =
146-
cx.tcx().struct_lockstep_tails_erasing_lifetimes(source, target, bx.param_env());
146+
cx.tcx().struct_lockstep_tails_for_codegen(source, target, bx.param_env());
147147
match (source.kind(), target.kind()) {
148148
(&ty::Array(_, len), &ty::Slice(_)) => {
149149
cx.const_usize(len.eval_target_usize(cx.tcx(), ty::ParamEnv::reveal_all()))

compiler/rustc_codegen_ssa/src/traits/type_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub trait DerivedTypeMethods<'tcx>: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {
9191
return false;
9292
}
9393

94-
let tail = self.tcx().struct_tail_erasing_lifetimes(ty, param_env);
94+
let tail = self.tcx().struct_tail_for_codegen(ty, param_env);
9595
match tail.kind() {
9696
ty::Foreign(..) => false,
9797
ty::Str | ty::Slice(..) | ty::Dynamic(..) => true,

compiler/rustc_const_eval/src/interpret/call.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
678678
} else {
679679
// Doesn't have to be a `dyn Trait`, but the unsized tail must be `dyn Trait`.
680680
// (For that reason we also cannot use `unpack_dyn_trait`.)
681-
let receiver_tail = self
682-
.tcx
683-
.struct_tail_erasing_lifetimes(receiver_place.layout.ty, self.param_env);
681+
let receiver_tail =
682+
self.tcx.struct_tail_for_codegen(receiver_place.layout.ty, self.param_env);
684683
let ty::Dynamic(receiver_trait, _, ty::Dyn) = receiver_tail.kind() else {
685684
span_bug!(
686685
self.cur_span(),

compiler/rustc_const_eval/src/interpret/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
386386
) -> InterpResult<'tcx> {
387387
// A<Struct> -> A<Trait> conversion
388388
let (src_pointee_ty, dest_pointee_ty) =
389-
self.tcx.struct_lockstep_tails_erasing_lifetimes(source_ty, cast_ty, self.param_env);
389+
self.tcx.struct_lockstep_tails_for_codegen(source_ty, cast_ty, self.param_env);
390390

391391
match (&src_pointee_ty.kind(), &dest_pointee_ty.kind()) {
392392
(&ty::Array(_, length), &ty::Slice(_)) => {

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> {
343343
meta: MemPlaceMeta<M::Provenance>,
344344
pointee: TyAndLayout<'tcx>,
345345
) -> InterpResult<'tcx> {
346-
let tail = self.ecx.tcx.struct_tail_erasing_lifetimes(pointee.ty, self.ecx.param_env);
346+
let tail = self.ecx.tcx.struct_tail_for_codegen(pointee.ty, self.ecx.param_env);
347347
match tail.kind() {
348348
ty::Dynamic(data, _, ty::Dyn) => {
349349
let vtable = meta.unwrap_meta().to_pointer(self.ecx)?;

compiler/rustc_const_eval/src/util/alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ where
2222
};
2323

2424
let ty = place.ty(local_decls, tcx).ty;
25-
let unsized_tail = || tcx.struct_tail_erasing_lifetimes(ty, param_env);
25+
let unsized_tail = || tcx.struct_tail_for_codegen(ty, param_env);
2626
match tcx.layout_of(param_env.and(ty)) {
2727
Ok(layout)
2828
if layout.align.abi <= pack

0 commit comments

Comments
 (0)