Move methods from Map to TyCtxt, part 5.

This eliminates all methods on `Map`. Actually removing `Map` will occur
in a follow-up PR.
This commit is contained in:
Nicholas Nethercote
2025-04-02 07:04:24 +11:00
parent 4304fa2955
commit 130af3fc3a
16 changed files with 22 additions and 24 deletions

View File

@@ -178,7 +178,6 @@ pub fn first_node_in_macro(cx: &LateContext<'_>, node: &impl HirNode) -> Option<
// get the parent node, possibly skipping over a statement
// if the parent is not found, it is sensible to return `Some(root)`
let hir = cx.tcx.hir();
let mut parent_iter = cx.tcx.hir_parent_iter(node.hir_id());
let (parent_id, _) = match parent_iter.next() {
None => return Some(ExpnId::root()),
@@ -190,7 +189,7 @@ pub fn first_node_in_macro(cx: &LateContext<'_>, node: &impl HirNode) -> Option<
};
// get the macro expansion of the parent node
let parent_span = hir.span(parent_id);
let parent_span = cx.tcx.hir_span(parent_id);
let Some(parent_macro_call) = macro_backtrace(parent_span).next() else {
// the parent node is not in a macro
return Some(ExpnId::root());