Skip to content

Commit

Permalink
Fix save-analysis generation panic with invalid tuple access
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Mar 6, 2018
1 parent 6f2100b commit c92630a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,10 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
}
}
ty::TyTuple(..) => {}
_ => span_bug!(ex.span, "Expected struct or tuple type, found {:?}", ty),
_ => {
debug!("Expected struct or tuple type, found {:?}", ty);
return;
}
}
}
ast::ExprKind::Closure(_, _, ref decl, ref body, _fn_decl_span) => {
Expand Down
4 changes: 4 additions & 0 deletions src/test/run-make/save-analysis-fail/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,7 @@ struct Rls699 {
fn new(f: u32) -> Rls699 {
Rls699 { fs }
}

fn invalid_tuple_struct_access() {
bar.0;
}

0 comments on commit c92630a

Please sign in to comment.