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.
opt_local_def_id
1 parent ec4bcaa commit 5a123c2Copy full SHA for 5a123c2
compiler/rustc_middle/src/hir/map/mod.rs
@@ -200,8 +200,12 @@ impl<'hir> Map<'hir> {
200
201
#[inline]
202
pub fn opt_local_def_id(&self, hir_id: HirId) -> Option<LocalDefId> {
203
- // FIXME(#85914) is this access safe for incr. comp.?
204
- self.tcx.untracked_resolutions.definitions.opt_hir_id_to_local_def_id(hir_id)
+ if hir_id.local_id == ItemLocalId::new(0) {
+ Some(hir_id.owner)
205
+ } else {
206
+ // FIXME(#85914) is this access safe for incr. comp.?
207
+ self.tcx.untracked_resolutions.definitions.opt_hir_id_to_local_def_id(hir_id)
208
+ }
209
}
210
211
0 commit comments