Skip to content

Commit

Permalink
Rollup merge of rust-lang#88677 - petrochenkov:exportid, r=davidtwco
Browse files Browse the repository at this point in the history
rustc: Remove local variable IDs from `Export`s

Local variables can never be exported.
  • Loading branch information
Manishearth authored Sep 12, 2021
2 parents e6455ea + 9163ac9 commit 6da1461
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
.iter()
.find(|item| item.ident.name.as_str() == name)
Expand Down Expand Up @@ -557,7 +557,7 @@ pub fn path_to_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
None
}
});
try_res!(last).res
try_res!(last).res.expect_non_local()
}

/// Convenience function to get the `DefId` of a trait by path.
Expand Down

0 comments on commit 6da1461

Please sign in to comment.