diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2019-04-14 13:14:17 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2019-04-14 13:15:20 -0700 |
| commit | 0c6956f8ce9e35b96b20d5cdc40bacf9f37322ff (patch) | |
| tree | fba3c684236c2de6c2cb1749bd4a049c43753dd1 | |
| parent | 1b2f2be085d9723fd72bd033b6fe81d8aa31c071 (diff) | |
| download | rust-0c6956f8ce9e35b96b20d5cdc40bacf9f37322ff.tar.gz rust-0c6956f8ce9e35b96b20d5cdc40bacf9f37322ff.zip | |
Use _from_hir_id APIs
| -rw-r--r-- | clippy_lints/src/loops.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/misc.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs index ccd8be38868..a070e824cc0 100644 --- a/clippy_lints/src/loops.rs +++ b/clippy_lints/src/loops.rs @@ -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; diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index a1e0f9d8345..bd0b4bd4515 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -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, } } |
