Use _from_hir_id APIs
This commit is contained in:
parent
1b2f2be085
commit
0c6956f8ce
@ -1657,7 +1657,7 @@ fn check_for_mutability(cx: &LateContext<'_, '_>, bound: &Expr) -> Option<HirId>
|
||||
then {
|
||||
let def = cx.tables.qpath_def(qpath, bound.hir_id);
|
||||
if let Def::Local(node_id) = def {
|
||||
let node_str = cx.tcx.hir().get(node_id);
|
||||
let node_str = cx.tcx.hir().get_by_hir_id(node_id);
|
||||
if_chain! {
|
||||
if let Node::Binding(pat) = node_str;
|
||||
if let PatKind::Binding(bind_ann, ..) = pat.node;
|
||||
|
@ -612,7 +612,7 @@ fn in_attributes_expansion(expr: &Expr) -> bool {
|
||||
/// Tests whether `def` is a variable defined outside a macro.
|
||||
fn non_macro_local(cx: &LateContext<'_, '_>, def: &def::Def) -> bool {
|
||||
match *def {
|
||||
def::Def::Local(id) | def::Def::Upvar(id, _, _) => !in_macro(cx.tcx.hir().span(id)),
|
||||
def::Def::Local(id) | def::Def::Upvar(id, _, _) => !in_macro(cx.tcx.hir().span_by_hir_id(id)),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user