note: NoteNone
}))
}
+
+ def::DefErr => panic!("DefErr in memory categorization")
}
}
(*op)(self, cmt.clone(), pat);
let opt_def = if let Some(path_res) = self.tcx().def_map.borrow().get(&pat.id) {
- if path_res.depth != 0 {
+ if path_res.depth != 0 || path_res.base_def == def::DefErr {
// Since patterns can be associated constants
// which are resolved during typeck, we might have
// some unresolved patterns reaching this stage
_ => {
self.tcx().sess.span_bug(
pat.span,
- "enum pattern didn't resolve to enum or struct");
+ &format!("enum pattern didn't resolve to enum or struct {:?}", opt_def));
}
}
}