Skip to content

Commit d2827aa

Browse files
committed
Fix build after rebase
1 parent cfc45d5 commit d2827aa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_const_eval/pattern.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl<'a, 'gcx, 'tcx> PatternContext<'a, 'gcx, 'tcx> {
408408
pattern: self.lower_pattern(field),
409409
})
410410
.collect();
411-
self.lower_variant_or_leaf(def, subpatterns)
411+
self.lower_variant_or_leaf(def, ty, subpatterns)
412412
}
413413

414414
PatKind::Struct(ref qpath, ref fields, _) => {
@@ -441,7 +441,7 @@ impl<'a, 'gcx, 'tcx> PatternContext<'a, 'gcx, 'tcx> {
441441
})
442442
.collect();
443443

444-
self.lower_variant_or_leaf(def, subpatterns)
444+
self.lower_variant_or_leaf(def, ty, subpatterns)
445445
}
446446
};
447447

@@ -531,15 +531,15 @@ impl<'a, 'gcx, 'tcx> PatternContext<'a, 'gcx, 'tcx> {
531531
fn lower_variant_or_leaf(
532532
&mut self,
533533
def: Def,
534+
ty: Ty<'tcx>,
534535
subpatterns: Vec<FieldPattern<'tcx>>)
535536
-> PatternKind<'tcx>
536537
{
537538
match def {
538539
Def::Variant(variant_id) | Def::VariantCtor(variant_id, ..) => {
539-
let ty = self.tcx.tables().node_id_to_type(pat.id);
540540
let (adt_def, substs) = match ty.sty {
541541
TypeVariants::TyAdt(adt_def, substs) => (adt_def, substs),
542-
_ => span_bug!(pat.span, "inappropriate type for def"),
542+
_ => bug!("inappropriate type for def"),
543543
};
544544
if adt_def.variants.len() > 1 {
545545
PatternKind::Variant {
@@ -584,7 +584,7 @@ impl<'a, 'gcx, 'tcx> PatternContext<'a, 'gcx, 'tcx> {
584584
}
585585
}
586586
}
587-
_ => self.lower_variant_or_leaf(def, vec![])
587+
_ => self.lower_variant_or_leaf(def, ty, vec![])
588588
};
589589

590590
Pattern {

0 commit comments

Comments
 (0)