Skip to content

Commit 0c6956f

Browse files
committed
Use _from_hir_id APIs
1 parent 1b2f2be commit 0c6956f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/loops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ fn check_for_mutability(cx: &LateContext<'_, '_>, bound: &Expr) -> Option<HirId>
16571657
then {
16581658
let def = cx.tables.qpath_def(qpath, bound.hir_id);
16591659
if let Def::Local(node_id) = def {
1660-
let node_str = cx.tcx.hir().get(node_id);
1660+
let node_str = cx.tcx.hir().get_by_hir_id(node_id);
16611661
if_chain! {
16621662
if let Node::Binding(pat) = node_str;
16631663
if let PatKind::Binding(bind_ann, ..) = pat.node;

clippy_lints/src/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ fn in_attributes_expansion(expr: &Expr) -> bool {
612612
/// Tests whether `def` is a variable defined outside a macro.
613613
fn non_macro_local(cx: &LateContext<'_, '_>, def: &def::Def) -> bool {
614614
match *def {
615-
def::Def::Local(id) | def::Def::Upvar(id, _, _) => !in_macro(cx.tcx.hir().span(id)),
615+
def::Def::Local(id) | def::Def::Upvar(id, _, _) => !in_macro(cx.tcx.hir().span_by_hir_id(id)),
616616
_ => false,
617617
}
618618
}

0 commit comments

Comments
 (0)