1
Fork 0

Rollup merge of #88677 - petrochenkov:exportid, r=davidtwco

rustc: Remove local variable IDs from `Export`s

Local variables can never be exported.
This commit is contained in:
Manish Goregaokar 2021-09-12 03:44:53 -07:00 committed by GitHub
commit 6da14613e7

View file

@ -520,7 +520,7 @@ pub fn path_to_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
} }
}; };
} }
fn item_child_by_name<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, name: &str) -> Option<&'tcx Export<HirId>> { fn item_child_by_name<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, name: &str) -> Option<&'tcx Export> {
tcx.item_children(def_id) tcx.item_children(def_id)
.iter() .iter()
.find(|item| item.ident.name.as_str() == name) .find(|item| item.ident.name.as_str() == name)
@ -557,7 +557,7 @@ pub fn path_to_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
None None
} }
}); });
try_res!(last).res try_res!(last).res.expect_non_local()
} }
/// Convenience function to get the `DefId` of a trait by path. /// Convenience function to get the `DefId` of a trait by path.