Skip to content

Commit 470635a

Browse files
committed
Update Clippy to support #[rustc_auto_trait]
1 parent 6e62320 commit 470635a

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

src/tools/clippy/clippy_lints/src/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
314314
hir::ItemKind::Impl(impl_) => {
315315
self.in_trait_impl = impl_.of_trait.is_some();
316316
},
317-
hir::ItemKind::Trait(_, unsafety, ..) => match (headers.safety, unsafety) {
317+
hir::ItemKind::Trait(unsafety, ..) => match (headers.safety, unsafety) {
318318
(false, hir::Unsafety::Unsafe) => span_lint(
319319
cx,
320320
MISSING_SAFETY_DOC,

src/tools/clippy/clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
8686
}
8787

8888
// find `self` ty for this trait if relevant
89-
if let ItemKind::Trait(_, _, _, _, items) = item.kind {
89+
if let ItemKind::Trait(_, _, _, items) = item.kind {
9090
for trait_item in items {
9191
if trait_item.id.owner_id.def_id == fn_def_id {
9292
// be sure we have `self` parameter in this function

src/tools/clippy/clippy_lints/src/len_zero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'tcx> LateLintPass<'tcx> for LenZero {
125125
return;
126126
}
127127

128-
if let ItemKind::Trait(_, _, _, _, trait_items) = item.kind {
128+
if let ItemKind::Trait(_, _, _, trait_items) = item.kind {
129129
check_trait_items(cx, item, trait_items);
130130
}
131131
}

src/tools/clippy/clippy_lints/src/missing_inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline {
9696
let attrs = cx.tcx.hir().attrs(it.hir_id());
9797
check_missing_inline_attrs(cx, attrs, it.span, desc);
9898
},
99-
hir::ItemKind::Trait(ref _is_auto, ref _unsafe, _generics, _bounds, trait_items) => {
99+
hir::ItemKind::Trait(ref _unsafe, _generics, _bounds, trait_items) => {
100100
// note: we need to check if the trait is exported so we can't use
101101
// `LateLintPass::check_trait_item` here.
102102
for tit in trait_items {

src/tools/clippy/clippy_lints/src/trait_bounds.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
112112
// special handling for self trait bounds as these are not considered generics
113113
// ie. trait Foo: Display {}
114114
if let Item {
115-
kind: ItemKind::Trait(_, _, _, bounds, ..),
115+
kind: ItemKind::Trait(_, _, bounds, ..),
116116
..
117117
} = item
118118
{
@@ -135,7 +135,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
135135
if let Some(
136136
Node::Item(
137137
Item {
138-
kind: ItemKind::Trait(_, _, _, self_bounds, _),
138+
kind: ItemKind::Trait(_, _, self_bounds, _),
139139
.. }
140140
)
141141
) = cx.tcx.hir().get_if_local(*def_id);

src/tools/clippy/clippy_utils/src/check_proc_macro.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_ast::AttrStyle;
1818
use rustc_hir::intravisit::FnKind;
1919
use rustc_hir::{
2020
Block, BlockCheckMode, Body, Closure, Destination, Expr, ExprKind, FieldDef, FnHeader, HirId, Impl, ImplItem,
21-
ImplItemKind, IsAuto, Item, ItemKind, LoopSource, MatchSource, MutTy, Node, QPath, TraitItem, TraitItemKind, Ty,
21+
ImplItemKind, Item, ItemKind, LoopSource, MatchSource, MutTy, Node, QPath, TraitItem, TraitItemKind, Ty,
2222
TyKind, UnOp, UnsafeSource, Unsafety, Variant, VariantData, YieldSource,
2323
};
2424
use rustc_lint::{LateContext, LintContext};
@@ -205,12 +205,11 @@ fn item_search_pat(item: &Item<'_>) -> (Pat, Pat) {
205205
ItemKind::Struct(VariantData::Struct(..), _) => (Pat::Str("struct"), Pat::Str("}")),
206206
ItemKind::Struct(..) => (Pat::Str("struct"), Pat::Str(";")),
207207
ItemKind::Union(..) => (Pat::Str("union"), Pat::Str("}")),
208-
ItemKind::Trait(_, Unsafety::Unsafe, ..)
208+
ItemKind::Trait(Unsafety::Unsafe, ..)
209209
| ItemKind::Impl(Impl {
210210
unsafety: Unsafety::Unsafe,
211211
..
212212
}) => (Pat::Str("unsafe"), Pat::Str("}")),
213-
ItemKind::Trait(IsAuto::Yes, ..) => (Pat::Str("auto"), Pat::Str("}")),
214213
ItemKind::Trait(..) => (Pat::Str("trait"), Pat::Str("}")),
215214
ItemKind::Impl(_) => (Pat::Str("impl"), Pat::Str("}")),
216215
_ => return (Pat::Str(""), Pat::Str("")),

0 commit comments

Comments
 (0)