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 @@ macro_rules! try_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)
.iter()
.find(|item| item.ident.name.as_str() == name)
@ -557,7 +557,7 @@ fn item_child_by_name<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, name: &str) -> Opt
None
}
});
try_res!(last).res
try_res!(last).res.expect_non_local()
}
/// Convenience function to get the `DefId` of a trait by path.