Skip to content

Commit 6d4b1b3

Browse files
committed
Remove ShallowInitBox.
1 parent 1210e9f commit 6d4b1b3

27 files changed

Lines changed: 8 additions & 173 deletions

File tree

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,8 +1544,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
15441544
Rvalue::Use(operand)
15451545
| Rvalue::Repeat(operand, _)
15461546
| Rvalue::UnaryOp(_ /*un_op*/, operand)
1547-
| Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/)
1548-
| Rvalue::ShallowInitBox(operand, _ /*ty*/) => {
1547+
| Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/) => {
15491548
self.consume_operand(location, (operand, span), state)
15501549
}
15511550

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
@@ -1004,17 +1004,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10041004
}
10051005
}
10061006

1007-
Rvalue::ShallowInitBox(_operand, ty) => {
1008-
let trait_ref =
1009-
ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, span), [*ty]);
1010-
1011-
self.prove_trait_ref(
1012-
trait_ref,
1013-
location.to_locations(),
1014-
ConstraintCategory::SizedBound,
1015-
);
1016-
}
1017-
10181007
Rvalue::Cast(cast_kind, op, ty) => {
10191008
match *cast_kind {
10201009
CastKind::PointerCoercion(
@@ -2231,7 +2220,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22312220
| Rvalue::Ref(..)
22322221
| Rvalue::RawPtr(..)
22332222
| Rvalue::Cast(..)
2234-
| Rvalue::ShallowInitBox(..)
22352223
| Rvalue::BinaryOp(..)
22362224
| Rvalue::CopyForDeref(..)
22372225
| Rvalue::UnaryOp(..)

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,6 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
902902
lval.write_cvalue_transmute(fx, operand);
903903
}
904904
Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in codegen"),
905-
Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in codegen"),
906905
}
907906
}
908907
StatementKind::StorageLive(_)

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
710710
OperandRef { val: operand.val, layout, move_annotation: None }
711711
}
712712
mir::Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in codegen"),
713-
mir::Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in codegen"),
714713
}
715714
}
716715

compiler/rustc_const_eval/src/check_consts/check.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
646646

647647
Rvalue::Cast(_, _, _) => {}
648648

649-
Rvalue::ShallowInitBox(_, _) => {}
650-
651649
Rvalue::UnaryOp(op, operand) => {
652650
let ty = operand.ty(self.body, self.tcx);
653651
match op {

compiler/rustc_const_eval/src/check_consts/qualifs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ where
237237
Rvalue::Use(operand)
238238
| Rvalue::Repeat(operand, _)
239239
| Rvalue::UnaryOp(_, operand)
240-
| Rvalue::Cast(_, operand, _)
241-
| Rvalue::ShallowInitBox(operand, _) => in_operand::<Q, _>(cx, in_local, operand),
240+
| Rvalue::Cast(_, operand, _) => in_operand::<Q, _>(cx, in_local, operand),
242241

243242
Rvalue::BinaryOp(_, box (lhs, rhs)) => {
244243
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
@@ -249,12 +249,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
249249
self.write_immediate(*val, &dest)?;
250250
}
251251

252-
ShallowInitBox(ref operand, _) => {
253-
let src = self.eval_operand(operand, None)?;
254-
let v = self.read_immediate(&src)?;
255-
self.write_immediate(*v, &dest)?;
256-
}
257-
258252
Cast(cast_kind, ref operand, cast_ty) => {
259253
let src = self.eval_operand(operand, None)?;
260254
let cast_ty =

compiler/rustc_middle/src/mir/pretty.rs

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

1240-
ShallowInitBox(ref place, ref ty) => {
1241-
with_no_trimmed_paths!(write!(fmt, "ShallowInitBox({place:?}, {ty})"))
1242-
}
1243-
12441240
WrapUnsafeBinder(ref op, ty) => {
12451241
with_no_trimmed_paths!(write!(fmt, "wrap_binder!({op:?}; {ty})"))
12461242
}

0 commit comments

Comments
 (0)