Rollup merge of #62091 - ljedrz:hiridification_almost_there, r=Zoxc

HirIdification: almost there

I'm beginning to run out of stuff to HirIdify 😉.

This time I targeted mainly `hir::map::{find, get_parent_node}`, but a few other bits got changed too.

r? @Zoxc
This commit is contained in:
Mazdak Farrokhzad 2019-06-25 17:15:36 +02:00 committed by GitHub
commit abc7423f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 119 additions and 128 deletions

View file

@ -570,14 +570,14 @@ fn is_enclosed(
used_unsafe: &FxHashSet<hir::HirId>,
id: hir::HirId,
) -> Option<(String, hir::HirId)> {
let parent_id = tcx.hir().get_parent_node_by_hir_id(id);
let parent_id = tcx.hir().get_parent_node(id);
if parent_id != id {
if used_unsafe.contains(&parent_id) {
Some(("block".to_string(), parent_id))
} else if let Some(Node::Item(&hir::Item {
node: hir::ItemKind::Fn(_, header, _, _),
..
})) = tcx.hir().find_by_hir_id(parent_id) {
})) = tcx.hir().find(parent_id) {
match header.unsafety {
hir::Unsafety::Unsafe => Some(("fn".to_string(), parent_id)),
hir::Unsafety::Normal => None,