From f6a5b608ef81311030f9852e074bca3d290651cd Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sun, 22 Dec 2019 15:56:34 +0100 Subject: [PATCH] Rustup to rust-lang/rust#66931 --- clippy_lints/src/attrs.rs | 2 +- clippy_lints/src/enum_clike.rs | 2 +- clippy_lints/src/enum_glob_use.rs | 2 +- clippy_lints/src/fallible_impl_from.rs | 4 ++-- clippy_lints/src/missing_inline.rs | 2 +- clippy_lints/src/needless_pass_by_value.rs | 2 +- clippy_lints/src/new_without_default.rs | 2 +- clippy_lints/src/partialeq_ne_impl.rs | 2 +- clippy_lints/src/serde_api.rs | 2 +- clippy_lints/src/unused_self.rs | 2 +- clippy_lints/src/use_self.rs | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index e281a39006be..410da312a5c0 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -232,7 +232,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes { ItemKind::ExternCrate(..) | ItemKind::Use(..) => { let skip_unused_imports = item.attrs.iter().any(|attr| attr.check_name(sym!(macro_use))); - for attr in &item.attrs { + for attr in item.attrs { if in_external_macro(cx.sess(), attr.span) { return; } diff --git a/clippy_lints/src/enum_clike.rs b/clippy_lints/src/enum_clike.rs index 1fa694b3ae1e..33ddf69fa51f 100644 --- a/clippy_lints/src/enum_clike.rs +++ b/clippy_lints/src/enum_clike.rs @@ -46,7 +46,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant { return; } if let ItemKind::Enum(def, _) = &item.kind { - for var in &def.variants { + for var in def.variants { if let Some(anon_const) = &var.disr_expr { let param_env = ty::ParamEnv::empty(); let def_id = cx.tcx.hir().body_owner_def_id(anon_const.body); diff --git a/clippy_lints/src/enum_glob_use.rs b/clippy_lints/src/enum_glob_use.rs index e7a5e520b917..7f4f1d85941d 100644 --- a/clippy_lints/src/enum_glob_use.rs +++ b/clippy_lints/src/enum_glob_use.rs @@ -32,7 +32,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse { fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod<'_>, _: Span, _: HirId) { let map = cx.tcx.hir(); // only check top level `use` statements - for item in &m.item_ids { + for item in m.item_ids { lint_item(cx, map.expect_item(item.id)); } } diff --git a/clippy_lints/src/fallible_impl_from.rs b/clippy_lints/src/fallible_impl_from.rs index e1343d9ada6d..d0ffc6c8eed9 100644 --- a/clippy_lints/src/fallible_impl_from.rs +++ b/clippy_lints/src/fallible_impl_from.rs @@ -36,7 +36,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FallibleImplFrom { // check for `impl From for ..` let impl_def_id = cx.tcx.hir().local_def_id(item.hir_id); if_chain! { - if let hir::ItemKind::Impl(.., ref impl_items) = item.kind; + if let hir::ItemKind::Impl(.., impl_items) = item.kind; if let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(impl_def_id); if match_def_path(cx, impl_trait_ref.def_id, &FROM_TRAIT); then { @@ -46,7 +46,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FallibleImplFrom { } } -fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_items: &hir::HirVec) { +fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_items: &[hir::ImplItemRef]) { use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc::hir::*; diff --git a/clippy_lints/src/missing_inline.rs b/clippy_lints/src/missing_inline.rs index 00ccd853cc35..790f070e4940 100644 --- a/clippy_lints/src/missing_inline.rs +++ b/clippy_lints/src/missing_inline.rs @@ -94,7 +94,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline { let desc = "a function"; check_missing_inline_attrs(cx, &it.attrs, it.span, desc); }, - hir::ItemKind::Trait(ref _is_auto, ref _unsafe, ref _generics, ref _bounds, ref trait_items) => { + hir::ItemKind::Trait(ref _is_auto, ref _unsafe, ref _generics, ref _bounds, trait_items) => { // note: we need to check if the trait is exported so we can't use // `LateLintPass::check_trait_item` here. for tit in trait_items { diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 8f786c5a121a..986cd94cfb3c 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -144,7 +144,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue { let fn_sig = cx.tcx.fn_sig(fn_def_id); let fn_sig = cx.tcx.erase_late_bound_regions(&fn_sig); - for (idx, ((input, &ty), arg)) in decl.inputs.iter().zip(fn_sig.inputs()).zip(&body.params).enumerate() { + for (idx, ((input, &ty), arg)) in decl.inputs.iter().zip(fn_sig.inputs()).zip(body.params).enumerate() { // All spans generated from a proc-macro invocation are the same... if span == input.span { return; diff --git a/clippy_lints/src/new_without_default.rs b/clippy_lints/src/new_without_default.rs index bbe76fae51ee..fea21ab1c46b 100644 --- a/clippy_lints/src/new_without_default.rs +++ b/clippy_lints/src/new_without_default.rs @@ -94,7 +94,7 @@ impl_lint_pass!(NewWithoutDefault => [NEW_WITHOUT_DEFAULT]); impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault { fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) { - if let hir::ItemKind::Impl(_, _, _, _, None, _, ref items) = item.kind { + if let hir::ItemKind::Impl(_, _, _, _, None, _, items) = item.kind { for assoc_item in items { if let hir::AssocItemKind::Method { has_self: false } = assoc_item.kind { let impl_item = cx.tcx.hir().impl_item(assoc_item.id); diff --git a/clippy_lints/src/partialeq_ne_impl.rs b/clippy_lints/src/partialeq_ne_impl.rs index 6e1c7561a3a2..b84a8840d5ee 100644 --- a/clippy_lints/src/partialeq_ne_impl.rs +++ b/clippy_lints/src/partialeq_ne_impl.rs @@ -34,7 +34,7 @@ declare_lint_pass!(PartialEqNeImpl => [PARTIALEQ_NE_IMPL]); impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PartialEqNeImpl { fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) { if_chain! { - if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, ref impl_items) = item.kind; + if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, impl_items) = item.kind; if !is_automatically_derived(&*item.attrs); if let Some(eq_trait) = cx.tcx.lang_items().eq_trait(); if trait_ref.path.res.def_id() == eq_trait; diff --git a/clippy_lints/src/serde_api.rs b/clippy_lints/src/serde_api.rs index aabdb8c73000..15cf50f80212 100644 --- a/clippy_lints/src/serde_api.rs +++ b/clippy_lints/src/serde_api.rs @@ -23,7 +23,7 @@ declare_lint_pass!(SerdeAPI => [SERDE_API_MISUSE]); impl<'a, 'tcx> LateLintPass<'a, 'tcx> for SerdeAPI { fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) { - if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, ref items) = item.kind { + if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, items) = item.kind { let did = trait_ref.path.res.def_id(); if let Some(visit_did) = get_trait_def_id(cx, &paths::SERDE_DE_VISITOR) { if did == visit_did { diff --git a/clippy_lints/src/unused_self.rs b/clippy_lints/src/unused_self.rs index e9f655287e68..00c919ee863c 100644 --- a/clippy_lints/src/unused_self.rs +++ b/clippy_lints/src/unused_self.rs @@ -44,7 +44,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedSelf { if item.span.from_expansion() { return; } - if let ItemKind::Impl(_, _, _, _, None, _, ref impl_item_refs) = item.kind { + if let ItemKind::Impl(_, _, _, _, None, _, impl_item_refs) = item.kind { for impl_item_ref in impl_item_refs { if_chain! { if let ImplItemRef { diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index bd1267d549a0..37b6c19ff2ba 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -170,7 +170,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseSelf { return; } if_chain! { - if let ItemKind::Impl(.., ref item_type, ref refs) = item.kind; + if let ItemKind::Impl(.., ref item_type, refs) = item.kind; if let TyKind::Path(QPath::Resolved(_, ref item_path)) = item_type.kind; then { let parameters = &item_path.segments.last().expect(SEGMENTS_MSG).args;