]> git.lizzy.rs Git - rust.git/commitdiff
Fix build after rebase
authorAndrew Cann <shum@canndrew.org>
Thu, 1 Dec 2016 04:41:21 +0000 (12:41 +0800)
committerAndrew Cann <shum@canndrew.org>
Tue, 3 Jan 2017 07:48:29 +0000 (15:48 +0800)
src/librustc_const_eval/pattern.rs

index ce2cd47572f5d9f9259f00c3f20fa1b9559f22aa..b92558680af8c703b0ca1dfcd7c516aa305124dc 100644 (file)
@@ -408,7 +408,7 @@ pub fn lower_pattern(&mut self, pat: &hir::Pat) -> Pattern<'tcx> {
                                        pattern: self.lower_pattern(field),
                                    })
                                    .collect();
-                self.lower_variant_or_leaf(def, subpatterns)
+                self.lower_variant_or_leaf(def, ty, subpatterns)
             }
 
             PatKind::Struct(ref qpath, ref fields, _) => {
@@ -441,7 +441,7 @@ pub fn lower_pattern(&mut self, pat: &hir::Pat) -> Pattern<'tcx> {
                           })
                           .collect();
 
-                self.lower_variant_or_leaf(def, subpatterns)
+                self.lower_variant_or_leaf(def, ty, subpatterns)
             }
         };
 
@@ -531,15 +531,15 @@ fn slice_or_array_pattern(
     fn lower_variant_or_leaf(
         &mut self,
         def: Def,
+        ty: Ty<'tcx>,
         subpatterns: Vec<FieldPattern<'tcx>>)
         -> PatternKind<'tcx>
     {
         match def {
             Def::Variant(variant_id) | Def::VariantCtor(variant_id, ..) => {
-                let ty = self.tcx.tables().node_id_to_type(pat.id);
                 let (adt_def, substs) = match ty.sty {
                     TypeVariants::TyAdt(adt_def, substs) => (adt_def, substs),
-                    _ => span_bug!(pat.span, "inappropriate type for def"),
+                    _ => bug!("inappropriate type for def"),
                 };
                 if adt_def.variants.len() > 1 {
                     PatternKind::Variant {
@@ -584,7 +584,7 @@ fn lower_path(&mut self,
                     }
                 }
             }
-            _ => self.lower_variant_or_leaf(def, vec![])
+            _ => self.lower_variant_or_leaf(def, ty, vec![])
         };
 
         Pattern {