about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/thir
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2021-08-05 03:16:19 +0200
committerest31 <MTest31@outlook.com>2021-08-18 09:25:26 +0200
commit8b0b7ef812d38b0ef2f5e69bea29cfd061141e2f (patch)
tree75626069e6e6ac1c5e20af6294bc8895f3aa3339 /compiler/rustc_mir_build/src/thir
parentcbe3afece59d85a53b9c7e085c1426c9bac2b526 (diff)
downloadrust-8b0b7ef812d38b0ef2f5e69bea29cfd061141e2f.tar.gz
rust-8b0b7ef812d38b0ef2f5e69bea29cfd061141e2f.zip
Remove box syntax from rustc_mir_build
Diffstat (limited to 'compiler/rustc_mir_build/src/thir')
-rw-r--r--compiler/rustc_mir_build/src/thir/cx/expr.rs18
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/mod.rs2
2 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
index 2b0aa41a4bd..6bbf1faf483 100644
--- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
+++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
@@ -132,7 +132,7 @@ impl<'tcx> Cx<'tcx> {
                     },
                 };
 
-                let expr = box [self.thir.exprs.push(expr)];
+                let expr = Box::new([self.thir.exprs.push(expr)]);
 
                 self.overloaded_place(hir_expr, adjustment.target, Some(call), expr, deref.span)
             }
@@ -190,7 +190,7 @@ impl<'tcx> Cx<'tcx> {
                     ExprKind::Call {
                         ty: method.ty,
                         fun: self.thir.exprs.push(method),
-                        args: box [self.mirror_expr(fun), tupled_args],
+                        args: Box::new([self.mirror_expr(fun), tupled_args]),
                         from_hir_call: true,
                         fn_span: expr.span,
                     }
@@ -266,7 +266,7 @@ impl<'tcx> Cx<'tcx> {
                 if self.typeck_results().is_method_call(expr) {
                     let lhs = self.mirror_expr(lhs);
                     let rhs = self.mirror_expr(rhs);
-                    self.overloaded_operator(expr, box [lhs, rhs])
+                    self.overloaded_operator(expr, Box::new([lhs, rhs]))
                 } else {
                     ExprKind::AssignOp {
                         op: bin_op(op.node),
@@ -286,7 +286,7 @@ impl<'tcx> Cx<'tcx> {
                 if self.typeck_results().is_method_call(expr) {
                     let lhs = self.mirror_expr(lhs);
                     let rhs = self.mirror_expr(rhs);
-                    self.overloaded_operator(expr, box [lhs, rhs])
+                    self.overloaded_operator(expr, Box::new([lhs, rhs]))
                 } else {
                     // FIXME overflow
                     match op.node {
@@ -317,7 +317,7 @@ impl<'tcx> Cx<'tcx> {
                 if self.typeck_results().is_method_call(expr) {
                     let lhs = self.mirror_expr(lhs);
                     let index = self.mirror_expr(index);
-                    self.overloaded_place(expr, expr_ty, None, box [lhs, index], expr.span)
+                    self.overloaded_place(expr, expr_ty, None, Box::new([lhs, index]), expr.span)
                 } else {
                     ExprKind::Index { lhs: self.mirror_expr(lhs), index: self.mirror_expr(index) }
                 }
@@ -326,7 +326,7 @@ impl<'tcx> Cx<'tcx> {
             hir::ExprKind::Unary(hir::UnOp::Deref, ref arg) => {
                 if self.typeck_results().is_method_call(expr) {
                     let arg = self.mirror_expr(arg);
-                    self.overloaded_place(expr, expr_ty, None, box [arg], expr.span)
+                    self.overloaded_place(expr, expr_ty, None, Box::new([arg]), expr.span)
                 } else {
                     ExprKind::Deref { arg: self.mirror_expr(arg) }
                 }
@@ -335,7 +335,7 @@ impl<'tcx> Cx<'tcx> {
             hir::ExprKind::Unary(hir::UnOp::Not, ref arg) => {
                 if self.typeck_results().is_method_call(expr) {
                     let arg = self.mirror_expr(arg);
-                    self.overloaded_operator(expr, box [arg])
+                    self.overloaded_operator(expr, Box::new([arg]))
                 } else {
                     ExprKind::Unary { op: UnOp::Not, arg: self.mirror_expr(arg) }
                 }
@@ -344,7 +344,7 @@ impl<'tcx> Cx<'tcx> {
             hir::ExprKind::Unary(hir::UnOp::Neg, ref arg) => {
                 if self.typeck_results().is_method_call(expr) {
                     let arg = self.mirror_expr(arg);
-                    self.overloaded_operator(expr, box [arg])
+                    self.overloaded_operator(expr, Box::new([arg]))
                 } else if let hir::ExprKind::Lit(ref lit) = arg.kind {
                     ExprKind::Literal {
                         literal: self.const_eval_literal(&lit.node, expr_ty, lit.span, true),
@@ -914,7 +914,7 @@ impl<'tcx> Cx<'tcx> {
                         variant_index: adt_def.variant_index_with_ctor_id(def_id),
                         substs,
                         user_ty: user_provided_type,
-                        fields: box [],
+                        fields: Box::new([]),
                         base: None,
                     })),
                     _ => bug!("unexpected ty: {:?}", ty),
diff --git a/compiler/rustc_mir_build/src/thir/pattern/mod.rs b/compiler/rustc_mir_build/src/thir/pattern/mod.rs
index dd265d881e6..5221ced1078 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/mod.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/mod.rs
@@ -600,7 +600,7 @@ crate trait PatternFolder<'tcx>: Sized {
 impl<'tcx, T: PatternFoldable<'tcx>> PatternFoldable<'tcx> for Box<T> {
     fn super_fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self {
         let content: T = (**self).fold_with(folder);
-        box content
+        Box::new(content)
     }
 }