Skip to content

Commit

Permalink
Fix ICE with save-analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Feb 2, 2020
1 parent 13db650 commit c377ed6
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
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
@@ -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
@@ -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 c377ed6

Please sign in to comment.