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:
commit
abc7423f27
35 changed files with 119 additions and 128 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue