Skip to content

Commit

Permalink
Catch a panic in save-analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Jul 24, 2017
1 parent 5134a5f commit 81fd86e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
ast::ExprKind::Struct(ref path, ref fields, ref base) => {
let hir_expr = self.save_ctxt.tcx.hir.expect_expr(ex.id);
let adt = match self.save_ctxt.tables.expr_ty_opt(&hir_expr) {
Some(ty) => ty.ty_adt_def().unwrap(),
None => {
Some(ty) if ty.ty_adt_def().is_some() => ty.ty_adt_def().unwrap(),
_ => {
visit::walk_expr(self, ex);
return;
}
Expand Down

0 comments on commit 81fd86e

Please sign in to comment.