Skip to content

Commit

Permalink
Auto merge of #68756 - JohnTitor:fix-ice-save-analysis-2, r=davidtwco
Browse files Browse the repository at this point in the history
Fix ICE with save-analysis

Fixes #68749

It should be fine since it's the same way as `visit_expr`.
  • Loading branch information
bors committed Feb 3, 2020
2 parents 01db581 + c377ed6 commit a2e8030
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 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 @@ -866,8 +866,8 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
// FIXME do something with _path?
let hir_id = self.tcx.hir().node_to_hir_id(p.id);
let adt = match self.save_ctxt.tables.node_type_opt(hir_id) {
Some(ty) => ty.ty_adt_def().unwrap(),
None => {
Some(ty) if ty.ty_adt_def().is_some() => ty.ty_adt_def().unwrap(),
_ => {
visit::walk_pat(self, p);
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/issues/issue-26459.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Zsave-analysis

fn main() {
match 'a' {
char{ch} => true
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-26459.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0574]: expected struct, variant or union type, found builtin type `char`
--> $DIR/issue-26459.rs:3:9
--> $DIR/issue-26459.rs:5:9
|
LL | char{ch} => true
| ^^^^ not a struct, variant or union type
Expand Down

0 comments on commit a2e8030

Please sign in to comment.