Skip to content

Commit f6a5b60

Browse files
committed
1 parent 9632e27 commit f6a5b60

11 files changed

+12
-12
lines changed

clippy_lints/src/attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
232232
ItemKind::ExternCrate(..) | ItemKind::Use(..) => {
233233
let skip_unused_imports = item.attrs.iter().any(|attr| attr.check_name(sym!(macro_use)));
234234

235-
for attr in &item.attrs {
235+
for attr in item.attrs {
236236
if in_external_macro(cx.sess(), attr.span) {
237237
return;
238238
}

clippy_lints/src/enum_clike.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
4646
return;
4747
}
4848
if let ItemKind::Enum(def, _) = &item.kind {
49-
for var in &def.variants {
49+
for var in def.variants {
5050
if let Some(anon_const) = &var.disr_expr {
5151
let param_env = ty::ParamEnv::empty();
5252
let def_id = cx.tcx.hir().body_owner_def_id(anon_const.body);

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
fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod<'_>, _: Span, _: HirId) {
3333
let map = cx.tcx.hir();
3434
// only check top level `use` statements
35-
for item in &m.item_ids {
35+
for item in m.item_ids {
3636
lint_item(cx, map.expect_item(item.id));
3737
}
3838
}

clippy_lints/src/fallible_impl_from.rs

+2-2
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(.., ref impl_items) = item.kind;
39+
if let hir::ItemKind::Impl(.., 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 {
@@ -46,7 +46,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FallibleImplFrom {
4646
}
4747
}
4848

49-
fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_items: &hir::HirVec<hir::ImplItemRef>) {
49+
fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_items: &[hir::ImplItemRef]) {
5050
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
5151
use rustc::hir::*;
5252

clippy_lints/src/missing_inline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline {
9494
let desc = "a function";
9595
check_missing_inline_attrs(cx, &it.attrs, it.span, desc);
9696
},
97-
hir::ItemKind::Trait(ref _is_auto, ref _unsafe, ref _generics, ref _bounds, ref trait_items) => {
97+
hir::ItemKind::Trait(ref _is_auto, ref _unsafe, ref _generics, ref _bounds, trait_items) => {
9898
// note: we need to check if the trait is exported so we can't use
9999
// `LateLintPass::check_trait_item` here.
100100
for tit in trait_items {

clippy_lints/src/needless_pass_by_value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
144144
let fn_sig = cx.tcx.fn_sig(fn_def_id);
145145
let fn_sig = cx.tcx.erase_late_bound_regions(&fn_sig);
146146

147-
for (idx, ((input, &ty), arg)) in decl.inputs.iter().zip(fn_sig.inputs()).zip(&body.params).enumerate() {
147+
for (idx, ((input, &ty), arg)) in decl.inputs.iter().zip(fn_sig.inputs()).zip(body.params).enumerate() {
148148
// All spans generated from a proc-macro invocation are the same...
149149
if span == input.span {
150150
return;

clippy_lints/src/new_without_default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl_lint_pass!(NewWithoutDefault => [NEW_WITHOUT_DEFAULT]);
9494

9595
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
9696
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
97-
if let hir::ItemKind::Impl(_, _, _, _, None, _, ref items) = item.kind {
97+
if let hir::ItemKind::Impl(_, _, _, _, None, _, items) = item.kind {
9898
for assoc_item in items {
9999
if let hir::AssocItemKind::Method { has_self: false } = assoc_item.kind {
100100
let impl_item = cx.tcx.hir().impl_item(assoc_item.id);

clippy_lints/src/partialeq_ne_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ declare_lint_pass!(PartialEqNeImpl => [PARTIALEQ_NE_IMPL]);
3434
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PartialEqNeImpl {
3535
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
3636
if_chain! {
37-
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, ref impl_items) = item.kind;
37+
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, impl_items) = item.kind;
3838
if !is_automatically_derived(&*item.attrs);
3939
if let Some(eq_trait) = cx.tcx.lang_items().eq_trait();
4040
if trait_ref.path.res.def_id() == eq_trait;

clippy_lints/src/serde_api.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ declare_lint_pass!(SerdeAPI => [SERDE_API_MISUSE]);
2323

2424
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for SerdeAPI {
2525
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
26-
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, ref items) = item.kind {
26+
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, items) = item.kind {
2727
let did = trait_ref.path.res.def_id();
2828
if let Some(visit_did) = get_trait_def_id(cx, &paths::SERDE_DE_VISITOR) {
2929
if did == visit_did {

clippy_lints/src/unused_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedSelf {
4444
if item.span.from_expansion() {
4545
return;
4646
}
47-
if let ItemKind::Impl(_, _, _, _, None, _, ref impl_item_refs) = item.kind {
47+
if let ItemKind::Impl(_, _, _, _, None, _, impl_item_refs) = item.kind {
4848
for impl_item_ref in impl_item_refs {
4949
if_chain! {
5050
if let ImplItemRef {

clippy_lints/src/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseSelf {
170170
return;
171171
}
172172
if_chain! {
173-
if let ItemKind::Impl(.., ref item_type, ref refs) = item.kind;
173+
if let ItemKind::Impl(.., ref item_type, refs) = item.kind;
174174
if let TyKind::Path(QPath::Resolved(_, ref item_path)) = item_type.kind;
175175
then {
176176
let parameters = &item_path.segments.last().expect(SEGMENTS_MSG).args;

0 commit comments

Comments
 (0)