提交 dcdadc4d 编写于 作者: E est31

Remove box syntax from rustc_middle

上级 8830f8e3
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#![feature(backtrace)] #![feature(backtrace)]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(discriminant_kind)] #![feature(discriminant_kind)]
#![feature(never_type)] #![feature(never_type)]
......
...@@ -2061,11 +2061,11 @@ pub fn function_handle( ...@@ -2061,11 +2061,11 @@ pub fn function_handle(
span: Span, span: Span,
) -> Self { ) -> Self {
let ty = tcx.type_of(def_id).subst(tcx, substs); let ty = tcx.type_of(def_id).subst(tcx, substs);
Operand::Constant(box Constant { Operand::Constant(Box::new(Constant {
span, span,
user_ty: None, user_ty: None,
literal: ConstantKind::Ty(ty::Const::zero_sized(tcx, ty)), literal: ConstantKind::Ty(ty::Const::zero_sized(tcx, ty)),
}) }))
} }
pub fn is_move(&self) -> bool { pub fn is_move(&self) -> bool {
...@@ -2092,11 +2092,11 @@ pub fn const_from_scalar( ...@@ -2092,11 +2092,11 @@ pub fn const_from_scalar(
}; };
scalar_size == type_size scalar_size == type_size
}); });
Operand::Constant(box Constant { Operand::Constant(Box::new(Constant {
span, span,
user_ty: None, user_ty: None,
literal: ConstantKind::Val(ConstValue::Scalar(val), ty), literal: ConstantKind::Val(ConstValue::Scalar(val), ty),
}) }))
} }
pub fn to_copy(&self) -> Self { pub fn to_copy(&self) -> Self {
......
...@@ -182,10 +182,10 @@ fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self { ...@@ -182,10 +182,10 @@ fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self {
Len(place) => Len(place.fold_with(folder)), Len(place) => Len(place.fold_with(folder)),
Cast(kind, op, ty) => Cast(kind, op.fold_with(folder), ty.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, 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, 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)), UnaryOp(op, val) => UnaryOp(op, val.fold_with(folder)),
Discriminant(place) => Discriminant(place.fold_with(folder)), Discriminant(place) => Discriminant(place.fold_with(folder)),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册