diff options
| author | bors <bors@rust-lang.org> | 2021-08-18 10:43:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-08-18 10:43:27 +0000 |
| commit | ba8cda2fa2c99ed6646f4dfe73bf4edad7e42a2d (patch) | |
| tree | 7adfa942c13a620d7ea6e0a9c0bb80e4eb5dd480 /compiler/rustc_middle | |
| parent | 896f058f13d6c8021f7637817953a44d3a78be32 (diff) | |
| parent | 0f081832b43db75073db2d8faecc84cf0ea7e271 (diff) | |
Auto merge of #87781 - est31:remove_box, r=oli-obk
Remove box syntax from compiler and tools Removes box syntax from the compiler and tools. In #49733, the future of box syntax is uncertain and the use in the compiler was listed as one of the reasons to keep it. Removal of box syntax [might affect the code generated](https://github.com/rust-lang/rust/pull/49646#issuecomment-379219615) and slow down the compiler so I'd recommend doing a perf run on this.
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/type_foldable.rs | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index f91067526b1..0e72e916cc6 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -29,7 +29,6 @@ #![feature(backtrace)] #![feature(bool_to_option)] #![feature(box_patterns)] -#![feature(box_syntax)] #![feature(core_intrinsics)] #![feature(discriminant_kind)] #![feature(never_type)] diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index da0d2575dcb..b66995afc6d 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -2061,11 +2061,11 @@ impl<'tcx> Operand<'tcx> { span: Span, ) -> Self { let ty = tcx.type_of(def_id).subst(tcx, substs); - Operand::Constant(box Constant { + Operand::Constant(Box::new(Constant { span, user_ty: None, literal: ConstantKind::Ty(ty::Const::zero_sized(tcx, ty)), - }) + })) } pub fn is_move(&self) -> bool { @@ -2092,11 +2092,11 @@ impl<'tcx> Operand<'tcx> { }; scalar_size == type_size }); - Operand::Constant(box Constant { + Operand::Constant(Box::new(Constant { span, user_ty: None, literal: ConstantKind::Val(ConstValue::Scalar(val), ty), - }) + })) } pub fn to_copy(&self) -> Self { diff --git a/compiler/rustc_middle/src/mir/type_foldable.rs b/compiler/rustc_middle/src/mir/type_foldable.rs index f3124e5bf42..b2d4a22194c 100644 --- a/compiler/rustc_middle/src/mir/type_foldable.rs +++ b/compiler/rustc_middle/src/mir/type_foldable.rs @@ -182,10 +182,10 @@ impl<'tcx> TypeFoldable<'tcx> for Rvalue<'tcx> { Len(place) => Len(place.fold_with(folder)), Cast(kind, op, ty) => Cast(kind, op.fold_with(folder), ty.fold_with(folder)), BinaryOp(op, box (rhs, lhs)) => { - BinaryOp(op, box (rhs.fold_with(folder), lhs.fold_with(folder))) + BinaryOp(op, Box::new((rhs.fold_with(folder), lhs.fold_with(folder)))) } CheckedBinaryOp(op, box (rhs, lhs)) => { - CheckedBinaryOp(op, box (rhs.fold_with(folder), lhs.fold_with(folder))) + CheckedBinaryOp(op, Box::new((rhs.fold_with(folder), lhs.fold_with(folder)))) } UnaryOp(op, val) => UnaryOp(op, val.fold_with(folder)), Discriminant(place) => Discriminant(place.fold_with(folder)), |
