Skip to content

Commit 81fd86e

Browse files
committed
Catch a panic in save-analysis
1 parent 5134a5f commit 81fd86e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_save_analysis/dump_visitor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1315,8 +1315,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
13151315
ast::ExprKind::Struct(ref path, ref fields, ref base) => {
13161316
let hir_expr = self.save_ctxt.tcx.hir.expect_expr(ex.id);
13171317
let adt = match self.save_ctxt.tables.expr_ty_opt(&hir_expr) {
1318-
Some(ty) => ty.ty_adt_def().unwrap(),
1319-
None => {
1318+
Some(ty) if ty.ty_adt_def().is_some() => ty.ty_adt_def().unwrap(),
1319+
_ => {
13201320
visit::walk_expr(self, ex);
13211321
return;
13221322
}

0 commit comments

Comments
 (0)