Skip to content

Fix ICE with save-analysis #68756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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