Skip to content

Commit c92630a

Browse files
committed
Fix save-analysis generation panic with invalid tuple access
1 parent 6f2100b commit c92630a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/librustc_save_analysis/dump_visitor.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,10 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
16751675
}
16761676
}
16771677
ty::TyTuple(..) => {}
1678-
_ => span_bug!(ex.span, "Expected struct or tuple type, found {:?}", ty),
1678+
_ => {
1679+
debug!("Expected struct or tuple type, found {:?}", ty);
1680+
return;
1681+
}
16791682
}
16801683
}
16811684
ast::ExprKind::Closure(_, _, ref decl, ref body, _fn_decl_span) => {

src/test/run-make/save-analysis-fail/foo.rs

+4
Original file line numberDiff line numberDiff line change
@@ -459,3 +459,7 @@ struct Rls699 {
459459
fn new(f: u32) -> Rls699 {
460460
Rls699 { fs }
461461
}
462+
463+
fn invalid_tuple_struct_access() {
464+
bar.0;
465+
}

0 commit comments

Comments
 (0)