Skip to content

Commit a2e8030

Browse files
committed
Auto merge of #68756 - JohnTitor:fix-ice-save-analysis-2, r=davidtwco
Fix ICE with save-analysis Fixes #68749 It should be fine since it's the same way as `visit_expr`.
2 parents 01db581 + c377ed6 commit a2e8030

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/librustc_save_analysis/dump_visitor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,8 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
866866
// FIXME do something with _path?
867867
let hir_id = self.tcx.hir().node_to_hir_id(p.id);
868868
let adt = match self.save_ctxt.tables.node_type_opt(hir_id) {
869-
Some(ty) => ty.ty_adt_def().unwrap(),
870-
None => {
869+
Some(ty) if ty.ty_adt_def().is_some() => ty.ty_adt_def().unwrap(),
870+
_ => {
871871
visit::walk_pat(self, p);
872872
return;
873873
}

src/test/ui/issues/issue-26459.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// compile-flags: -Zsave-analysis
2+
13
fn main() {
24
match 'a' {
35
char{ch} => true

src/test/ui/issues/issue-26459.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0574]: expected struct, variant or union type, found builtin type `char`
2-
--> $DIR/issue-26459.rs:3:9
2+
--> $DIR/issue-26459.rs:5:9
33
|
44
LL | char{ch} => true
55
| ^^^^ not a struct, variant or union type

0 commit comments

Comments
 (0)