Skip to content

Commit 868f168

Browse files
committed
Auto merge of #4215 - matthiaskrgr:rustup_9, r=flip1995
rustup #61836 changelog: none
2 parents ab085d9 + 4d984dc commit 868f168

File tree

9 files changed

+12
-11
lines changed

9 files changed

+12
-11
lines changed

clippy_lints/src/derive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn check_hash_peq<'a, 'tcx>(
114114
cx, DERIVE_HASH_XOR_EQ, span,
115115
mess,
116116
|db| {
117-
if let Some(node_id) = cx.tcx.hir().as_local_node_id(impl_id) {
117+
if let Some(node_id) = cx.tcx.hir().as_local_hir_id(impl_id) {
118118
db.span_note(
119119
cx.tcx.hir().span(node_id),
120120
"`PartialEq` implemented here"

clippy_lints/src/enum_glob_use.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
3232
let map = cx.tcx.hir();
3333
// only check top level `use` statements
3434
for item in &m.item_ids {
35-
self.lint_item(cx, map.expect_item(map.hir_to_node_id(item.id)));
35+
self.lint_item(cx, map.expect_item(item.id));
3636
}
3737
}
3838
}

clippy_lints/src/escape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
9494
span_lint(
9595
cx,
9696
BOXED_LOCAL,
97-
cx.tcx.hir().span_by_hir_id(node),
97+
cx.tcx.hir().span(node),
9898
"local variable doesn't need to be boxed here",
9999
);
100100
}

clippy_lints/src/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
346346
},
347347
TyKind::Def(item, _) => {
348348
let map = self.cx.tcx.hir();
349-
if let ItemKind::Existential(ref exist_ty) = map.expect_item(map.hir_to_node_id(item.id)).node {
349+
if let ItemKind::Existential(ref exist_ty) = map.expect_item(item.id).node {
350350
for bound in &exist_ty.bounds {
351351
if let GenericBound::Outlives(_) = *bound {
352352
self.record(&None);

clippy_lints/src/methods/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
947947
}
948948
let name = implitem.ident.name.as_str();
949949
let parent = cx.tcx.hir().get_parent_item(implitem.hir_id);
950-
let item = cx.tcx.hir().expect_item_by_hir_id(parent);
950+
let item = cx.tcx.hir().expect_item(parent);
951951
let def_id = cx.tcx.hir().local_def_id_from_hir_id(item.hir_id);
952952
let ty = cx.tcx.type_of(def_id);
953953
if_chain! {
@@ -1070,7 +1070,7 @@ fn lint_or_fun_call<'a, 'tcx: 'a>(
10701070

10711071
if call_found {
10721072
// don't lint for constant values
1073-
let owner_def = self.cx.tcx.hir().get_parent_did_by_hir_id(expr.hir_id);
1073+
let owner_def = self.cx.tcx.hir().get_parent_did(expr.hir_id);
10741074
let promotable = self
10751075
.cx
10761076
.tcx

clippy_lints/src/misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ fn in_attributes_expansion(expr: &Expr) -> bool {
605605
/// Tests whether `res` is a variable defined outside a macro.
606606
fn non_macro_local(cx: &LateContext<'_, '_>, res: def::Res) -> bool {
607607
if let def::Res::Local(id) = res {
608-
!in_macro_or_desugar(cx.tcx.hir().span_by_hir_id(id))
608+
!in_macro_or_desugar(cx.tcx.hir().span(id))
609609
} else {
610610
false
611611
}

clippy_lints/src/new_without_default.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
146146
if let Some(self_def) = cx.tcx.type_of(self_did).ty_adt_def();
147147
if self_def.did.is_local();
148148
then {
149-
let self_id = cx.tcx.hir().local_def_id_to_node_id(self_def.did.to_local());
150-
if impling_types.contains(&self_id) {
149+
let self_id = cx.tcx.hir().local_def_id_to_hir_id(self_def.did.to_local());
150+
let node_id = cx.tcx.hir().hir_to_node_id(self_id);
151+
if impling_types.contains(&node_id) {
151152
return;
152153
}
153154
}

clippy_lints/src/non_copy_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
170170
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem) {
171171
if let ImplItemKind::Const(hir_ty, ..) = &impl_item.node {
172172
let item_hir_id = cx.tcx.hir().get_parent_node_by_hir_id(impl_item.hir_id);
173-
let item = cx.tcx.hir().expect_item_by_hir_id(item_hir_id);
173+
let item = cx.tcx.hir().expect_item(item_hir_id);
174174
// Ensure the impl is an inherent impl.
175175
if let ItemKind::Impl(_, _, _, _, None, _, _) = item.node {
176176
let ty = hir_ty_to_ty(cx.tcx, hir_ty);

clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ pub fn any_parent_is_automatically_derived(tcx: TyCtxt<'_>, node: HirId) -> bool
978978
let mut prev_enclosing_node = None;
979979
let mut enclosing_node = node;
980980
while Some(enclosing_node) != prev_enclosing_node {
981-
if is_automatically_derived(map.attrs_by_hir_id(enclosing_node)) {
981+
if is_automatically_derived(map.attrs(enclosing_node)) {
982982
return true;
983983
}
984984
prev_enclosing_node = Some(enclosing_node);

0 commit comments

Comments
 (0)