We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a80d449 commit daa7408Copy full SHA for daa7408
src/librustc/front/map/mod.rs
@@ -325,7 +325,17 @@ impl<'ast> Map<'ast> {
325
return DepNode::Krate,
326
327
NotPresent =>
328
- panic!("Walking parents from `{}` led to `NotPresent` at `{}`", id0, id),
+ // Some nodes, notably struct fields, are not
329
+ // present in the map for whatever reason, but
330
+ // they *do* have def-ids. So if we encounter an
331
+ // empty hole, check for that case.
332
+ return self.opt_local_def_id(id)
333
+ .map(|def_id| DepNode::Hir(def_id))
334
+ .unwrap_or_else(|| {
335
+ panic!("Walking parents from `{}` \
336
+ led to `NotPresent` at `{}`",
337
+ id0, id)
338
+ }),
339
}
340
341
0 commit comments