Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove box syntax from rustc_middle
  • Loading branch information
est31 committed Aug 18, 2021
1 parent 8830f8e commit dcdadc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/lib.rs
Expand Up @@ -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)]
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_middle/src/mir/mod.rs
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/type_foldable.rs
Expand Up @@ -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)),
Expand Down

0 comments on commit dcdadc4

Please sign in to comment.