Skip to content

Commit e5fe56d

Browse files
committed
Auto merge of rust-lang#5489 - phansch:node-id-hir-id, r=flip1995
Cleanup: `node_id` -> `hir_id` This removes some more `node_id` terminology from Clippy and replaces one occurrence of `as_local_node_id` with `as_local_hir_id`, which should be doing the same for that particular case. changelog: none
2 parents 6ed2ae8 + c3c00e5 commit e5fe56d

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

clippy_lints/src/derive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ fn check_hash_peq<'a, 'tcx>(
120120
cx, DERIVE_HASH_XOR_EQ, span,
121121
mess,
122122
|diag| {
123-
if let Some(node_id) = cx.tcx.hir().as_local_hir_id(impl_id) {
123+
if let Some(hir_id) = cx.tcx.hir().as_local_hir_id(impl_id) {
124124
diag.span_note(
125-
cx.tcx.hir().span(node_id),
125+
cx.tcx.hir().span(hir_id),
126126
"`PartialEq` implemented here"
127127
);
128128
}

clippy_lints/src/loops.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1652,14 +1652,14 @@ fn check_for_mutability(cx: &LateContext<'_, '_>, bound: &Expr<'_>) -> Option<Hi
16521652
if let QPath::Resolved(None, _) = *qpath;
16531653
then {
16541654
let res = qpath_res(cx, qpath, bound.hir_id);
1655-
if let Res::Local(node_id) = res {
1656-
let node_str = cx.tcx.hir().get(node_id);
1655+
if let Res::Local(hir_id) = res {
1656+
let node_str = cx.tcx.hir().get(hir_id);
16571657
if_chain! {
16581658
if let Node::Binding(pat) = node_str;
16591659
if let PatKind::Binding(bind_ann, ..) = pat.kind;
16601660
if let BindingAnnotation::Mutable = bind_ann;
16611661
then {
1662-
return Some(node_id);
1662+
return Some(hir_id);
16631663
}
16641664
}
16651665
}
@@ -2184,8 +2184,8 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
21842184
fn var_def_id(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> Option<HirId> {
21852185
if let ExprKind::Path(ref qpath) = expr.kind {
21862186
let path_res = qpath_res(cx, qpath, expr.hir_id);
2187-
if let Res::Local(node_id) = path_res {
2188-
return Some(node_id);
2187+
if let Res::Local(hir_id) = path_res {
2188+
return Some(hir_id);
21892189
}
21902190
}
21912191
None
@@ -2422,8 +2422,8 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
24222422
let res = qpath_res(self.cx, qpath, ex.hir_id);
24232423
then {
24242424
match res {
2425-
Res::Local(node_id) => {
2426-
self.ids.insert(node_id);
2425+
Res::Local(hir_id) => {
2426+
self.ids.insert(hir_id);
24272427
},
24282428
Res::Def(DefKind::Static, def_id) => {
24292429
let mutable = self.cx.tcx.is_mutable_static(def_id);

clippy_lints/src/missing_inline.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline {
152152
};
153153

154154
if let Some(trait_def_id) = trait_def_id {
155-
if cx.tcx.hir().as_local_node_id(trait_def_id).is_some() && !cx.access_levels.is_exported(impl_item.hir_id)
156-
{
155+
if cx.tcx.hir().as_local_hir_id(trait_def_id).is_some() && !cx.access_levels.is_exported(impl_item.hir_id) {
157156
// If a trait is being implemented for an item, and the
158157
// trait is not exported, we don't need #[inline]
159158
return;

0 commit comments

Comments
 (0)