Skip to content

Commit 10603a7

Browse files
committed
Remove ShallowInitBox.
1 parent 3caded1 commit 10603a7

File tree

40 files changed

+10
-282
lines changed

40 files changed

+10
-282
lines changed

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,8 +1533,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
15331533
Rvalue::Use(operand)
15341534
| Rvalue::Repeat(operand, _)
15351535
| Rvalue::UnaryOp(_ /*un_op*/, operand)
1536-
| Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/)
1537-
| Rvalue::ShallowInitBox(operand, _ /*ty*/) => {
1536+
| Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/) => {
15381537
self.consume_operand(location, (operand, span), state)
15391538
}
15401539

compiler/rustc_borrowck/src/polonius/legacy/loan_invalidations.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@ impl<'a, 'tcx> LoanInvalidationsGenerator<'a, 'tcx> {
297297
Rvalue::Use(operand)
298298
| Rvalue::Repeat(operand, _)
299299
| Rvalue::UnaryOp(_ /*un_op*/, operand)
300-
| Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/)
301-
| Rvalue::ShallowInitBox(operand, _ /*ty*/) => self.consume_operand(location, operand),
300+
| Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/) => {
301+
self.consume_operand(location, operand)
302+
}
302303

303304
&Rvalue::Discriminant(place) => {
304305
self.access_place(

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,17 +1059,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10591059
&Rvalue::NullaryOp(NullOp::ContractChecks, _) => {}
10601060
&Rvalue::NullaryOp(NullOp::UbChecks, _) => {}
10611061

1062-
Rvalue::ShallowInitBox(_operand, ty) => {
1063-
let trait_ref =
1064-
ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, span), [*ty]);
1065-
1066-
self.prove_trait_ref(
1067-
trait_ref,
1068-
location.to_locations(),
1069-
ConstraintCategory::SizedBound,
1070-
);
1071-
}
1072-
10731062
Rvalue::Cast(cast_kind, op, ty) => {
10741063
match *cast_kind {
10751064
CastKind::PointerCoercion(PointerCoercion::ReifyFnPointer, coercion_source) => {
@@ -2211,7 +2200,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22112200
| Rvalue::Ref(..)
22122201
| Rvalue::RawPtr(..)
22132202
| Rvalue::Cast(..)
2214-
| Rvalue::ShallowInitBox(..)
22152203
| Rvalue::BinaryOp(..)
22162204
| Rvalue::NullaryOp(..)
22172205
| Rvalue::CopyForDeref(..)

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,6 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
917917
lval.write_cvalue_transmute(fx, operand);
918918
}
919919
Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in codegen"),
920-
Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in codegen"),
921920
}
922921
}
923922
StatementKind::StorageLive(_)

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
731731
OperandRef { val: operand.val, layout }
732732
}
733733
mir::Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in codegen"),
734-
mir::Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in codegen"),
735734
}
736735
}
737736

compiler/rustc_const_eval/src/check_consts/check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
653653
| NullOp::ContractChecks,
654654
_,
655655
) => {}
656-
Rvalue::ShallowInitBox(_, _) => {}
657656

658657
Rvalue::UnaryOp(op, operand) => {
659658
let ty = operand.ty(self.body, self.tcx);

compiler/rustc_const_eval/src/check_consts/qualifs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ where
239239
Rvalue::Use(operand)
240240
| Rvalue::Repeat(operand, _)
241241
| Rvalue::UnaryOp(_, operand)
242-
| Rvalue::Cast(_, operand, _)
243-
| Rvalue::ShallowInitBox(operand, _) => in_operand::<Q, _>(cx, in_local, operand),
242+
| Rvalue::Cast(_, operand, _) => in_operand::<Q, _>(cx, in_local, operand),
244243

245244
Rvalue::BinaryOp(_, box (lhs, rhs)) => {
246245
in_operand::<Q, _>(cx, in_local, lhs) || in_operand::<Q, _>(cx, in_local, rhs)

compiler/rustc_const_eval/src/check_consts/resolver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ where
192192
}
193193

194194
mir::Rvalue::Cast(..)
195-
| mir::Rvalue::ShallowInitBox(..)
196195
| mir::Rvalue::Use(..)
197196
| mir::Rvalue::CopyForDeref(..)
198197
| mir::Rvalue::ThreadLocalRef(..)

compiler/rustc_const_eval/src/interpret/step.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
255255
self.write_immediate(*val, &dest)?;
256256
}
257257

258-
ShallowInitBox(ref operand, _) => {
259-
let src = self.eval_operand(operand, None)?;
260-
let v = self.read_immediate(&src)?;
261-
self.write_immediate(*v, &dest)?;
262-
}
263-
264258
Cast(cast_kind, ref operand, cast_ty) => {
265259
let src = self.eval_operand(operand, None)?;
266260
let cast_ty =

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,10 +1239,6 @@ impl<'tcx> Debug for Rvalue<'tcx> {
12391239
}
12401240
}
12411241

1242-
ShallowInitBox(ref place, ref ty) => {
1243-
with_no_trimmed_paths!(write!(fmt, "ShallowInitBox({place:?}, {ty})"))
1244-
}
1245-
12461242
WrapUnsafeBinder(ref op, ty) => {
12471243
with_no_trimmed_paths!(write!(fmt, "wrap_binder!({op:?}; {ty})"))
12481244
}

0 commit comments

Comments
 (0)