Skip to content

Commit e36a33f

Browse files
committed
Auto merge of rust-lang#5059 - JohnTitor:rustup-0118, r=llogiq
Rustup to rust-lang/rust#68204 changelog: none
2 parents 6bd0580 + e72f0e6 commit e36a33f

24 files changed

+75
-28
lines changed

clippy_lints/src/copy_iterator.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ declare_lint_pass!(CopyIterator => [COPY_ITERATOR]);
3333

3434
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyIterator {
3535
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
36-
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.kind {
36+
if let ItemKind::Impl {
37+
of_trait: Some(ref trait_ref),
38+
..
39+
} = item.kind
40+
{
3741
let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id(item.hir_id));
3842

3943
if is_copy(cx, ty) && match_path(&trait_ref.path, &paths::ITERATOR) {

clippy_lints/src/derive.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ declare_lint_pass!(Derive => [EXPL_IMPL_CLONE_ON_COPY, DERIVE_HASH_XOR_EQ]);
6666

6767
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
6868
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
69-
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.kind {
69+
if let ItemKind::Impl {
70+
of_trait: Some(ref trait_ref),
71+
..
72+
} = item.kind
73+
{
7074
let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id(item.hir_id));
7175
let is_automatically_derived = is_automatically_derived(&*item.attrs);
7276

clippy_lints/src/doc.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,18 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DocMarkdown {
159159
lint_for_missing_headers(cx, item.hir_id, item.span, sig, headers);
160160
}
161161
},
162-
hir::ItemKind::Impl(_, _, _, _, ref trait_ref, ..) => {
162+
hir::ItemKind::Impl {
163+
of_trait: ref trait_ref,
164+
..
165+
} => {
163166
self.in_trait_impl = trait_ref.is_some();
164167
},
165168
_ => {},
166169
}
167170
}
168171

169172
fn check_item_post(&mut self, _cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
170-
if let hir::ItemKind::Impl(..) = item.kind {
173+
if let hir::ItemKind::Impl { .. } = item.kind {
171174
self.in_trait_impl = false;
172175
}
173176
}

clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
6464
let parent_node = cx.tcx.hir().find(parent_id);
6565

6666
if let Some(Node::Item(item)) = parent_node {
67-
if let ItemKind::Impl(_, _, _, _, Some(..), _, _) = item.kind {
67+
if let ItemKind::Impl { of_trait: Some(_), .. } = item.kind {
6868
return;
6969
}
7070
}

clippy_lints/src/fallible_impl_from.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FallibleImplFrom {
3636
// check for `impl From<???> for ..`
3737
let impl_def_id = cx.tcx.hir().local_def_id(item.hir_id);
3838
if_chain! {
39-
if let hir::ItemKind::Impl(.., impl_items) = item.kind;
39+
if let hir::ItemKind::Impl{ items: impl_items, .. } = item.kind;
4040
if let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(impl_def_id);
4141
if match_def_path(cx, impl_trait_ref.def_id, &FROM_TRAIT);
4242
then {

clippy_lints/src/functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
196196
hir_id: hir::HirId,
197197
) {
198198
let is_impl = if let Some(hir::Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
199-
matches!(item.kind, hir::ItemKind::Impl(_, _, _, _, Some(_), _, _))
199+
matches!(item.kind, hir::ItemKind::Impl{ of_trait: Some(_), .. })
200200
} else {
201201
false
202202
};

clippy_lints/src/inherent_impl.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ impl_lint_pass!(MultipleInherentImpl => [MULTIPLE_INHERENT_IMPL]);
4949

5050
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MultipleInherentImpl {
5151
fn check_item(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
52-
if let ItemKind::Impl(_, _, _, ref generics, None, _, _) = item.kind {
52+
if let ItemKind::Impl {
53+
ref generics,
54+
of_trait: None,
55+
..
56+
} = item.kind
57+
{
5358
// Remember for each inherent implementation encoutered its span and generics
5459
// but filter out implementations that have generic params (type or lifetime)
5560
// or are derived from a macro

clippy_lints/src/len_zero.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
7878

7979
match item.kind {
8080
ItemKind::Trait(_, _, _, _, ref trait_items) => check_trait_items(cx, item, trait_items),
81-
ItemKind::Impl(_, _, _, _, None, _, ref impl_items) => check_impl_items(cx, item, impl_items),
81+
ItemKind::Impl {
82+
of_trait: None,
83+
items: ref impl_items,
84+
..
85+
} => check_impl_items(cx, item, impl_items),
8286
_ => (),
8387
}
8488
}

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
13351335
if_chain! {
13361336
if let hir::ImplItemKind::Method(ref sig, id) = impl_item.kind;
13371337
if let Some(first_arg) = iter_input_pats(&sig.decl, cx.tcx.hir().body(id)).next();
1338-
if let hir::ItemKind::Impl(_, _, _, _, None, _, _) = item.kind;
1338+
if let hir::ItemKind::Impl{ of_trait: None, .. } = item.kind;
13391339

13401340
let method_def_id = cx.tcx.hir().local_def_id(impl_item.hir_id);
13411341
let method_sig = cx.tcx.fn_sig(method_def_id);

clippy_lints/src/missing_doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
154154
hir::ItemKind::ExternCrate(..)
155155
| hir::ItemKind::ForeignMod(..)
156156
| hir::ItemKind::GlobalAsm(..)
157-
| hir::ItemKind::Impl(..)
157+
| hir::ItemKind::Impl { .. }
158158
| hir::ItemKind::Use(..) => return,
159159
};
160160

0 commit comments

Comments
 (0)