about summary refs log tree commit diff
path: root/src/librustc_const_eval
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-01-21 17:40:31 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-01-30 23:14:15 +0300
commitffba0cea621c2609582b4e201b76b3b19860ec4f (patch)
tree48c8591c66b1601160f311d4b882f8b27bfcbe28 /src/librustc_const_eval
parent55f9712d14126bce39357e6160a638ce7886e982 (diff)
Merge ty::TyBox into ty::TyAdt
Diffstat (limited to 'src/librustc_const_eval')
-rw-r--r--src/librustc_const_eval/_match.rs2
-rw-r--r--src/librustc_const_eval/pattern.rs2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/librustc_const_eval/_match.rs b/src/librustc_const_eval/_match.rs
index 1770a112cdf..94b2ba58c9a 100644
--- a/src/librustc_const_eval/_match.rs
+++ b/src/librustc_const_eval/_match.rs
@@ -722,7 +722,6 @@ fn constructor_arity(_cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> usize
     debug!("constructor_arity({:?}, {:?})", ctor, ty);
     match ty.sty {
         ty::TyTuple(ref fs) => fs.len(),
-        ty::TyBox(_) => 1,
         ty::TySlice(..) | ty::TyArray(..) => match *ctor {
             Slice(length) => length,
             ConstantValue(_) => 0,
@@ -747,7 +746,6 @@ fn constructor_sub_pattern_tys<'a, 'tcx: 'a>(cx: &MatchCheckCtxt<'a, 'tcx>,
     debug!("constructor_sub_pattern_tys({:?}, {:?})", ctor, ty);
     match ty.sty {
         ty::TyTuple(ref fs) => fs.into_iter().map(|t| *t).collect(),
-        ty::TyBox(ty) => vec![ty],
         ty::TySlice(ty) | ty::TyArray(ty, _) => match *ctor {
             Slice(length) => repeat(ty).take(length).collect(),
             ConstantValue(_) => vec![],
diff --git a/src/librustc_const_eval/pattern.rs b/src/librustc_const_eval/pattern.rs
index a3b80ebddcf..c6272613f4d 100644
--- a/src/librustc_const_eval/pattern.rs
+++ b/src/librustc_const_eval/pattern.rs
@@ -215,7 +215,7 @@ impl<'tcx> fmt::Display for Pattern<'tcx> {
             }
             PatternKind::Deref { ref subpattern } => {
                 match self.ty.sty {
-                    ty::TyBox(_) => write!(f, "box ")?,
+                    ty::TyAdt(def, _) if def.is_box() => write!(f, "box ")?,
                     ty::TyRef(_, mt) => {
                         write!(f, "&")?;
                         if mt.mutbl == hir::MutMutable {