Fix save-analysis generation panic with invalid tuple access

This commit is contained in:
Shotaro Yamada 2018-03-06 22:23:06 +09:00
parent 6f2100b92c
commit c92630a04a
2 changed files with 8 additions and 1 deletions

View File

@ -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) => {

View File

@ -459,3 +459,7 @@ struct Rls699 {
fn new(f: u32) -> Rls699 {
Rls699 { fs }
}
fn invalid_tuple_struct_access() {
bar.0;
}