From 9533fa5b194775293de8682f41db12d9d93e7452 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Thu, 15 Aug 2019 09:59:08 +0200 Subject: [PATCH] Rustup to rust-lang/rust#63543 --- clippy_lints/src/enum_clike.rs | 5 ++--- clippy_lints/src/enum_variants.rs | 2 +- clippy_lints/src/large_enum_variant.rs | 2 +- clippy_lints/src/missing_doc.rs | 2 +- clippy_lints/src/utils/author.rs | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/clippy_lints/src/enum_clike.rs b/clippy_lints/src/enum_clike.rs index d2931acc5..079b3bd3f 100644 --- a/clippy_lints/src/enum_clike.rs +++ b/clippy_lints/src/enum_clike.rs @@ -43,10 +43,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant { if cx.tcx.data_layout.pointer_size.bits() != 64 { return; } - if let ItemKind::Enum(ref def, _) = item.node { + if let ItemKind::Enum(def, _) = &item.node { for var in &def.variants { - let variant = &var.node; - if let Some(ref anon_const) = variant.disr_expr { + 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); let substs = InternalSubsts::identity_for_item(cx.tcx.global_tcx(), def_id); diff --git a/clippy_lints/src/enum_variants.rs b/clippy_lints/src/enum_variants.rs index 1cc3bda3b..cf61683cb 100644 --- a/clippy_lints/src/enum_variants.rs +++ b/clippy_lints/src/enum_variants.rs @@ -123,7 +123,7 @@ impl_lint_pass!(EnumVariantNames => [ ]); fn var2str(var: &Variant) -> LocalInternedString { - var.node.ident.as_str() + var.ident.as_str() } /// Returns the number of chars that match from the start diff --git a/clippy_lints/src/large_enum_variant.rs b/clippy_lints/src/large_enum_variant.rs index b59b58505..2c2f4d84c 100644 --- a/clippy_lints/src/large_enum_variant.rs +++ b/clippy_lints/src/large_enum_variant.rs @@ -85,7 +85,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeEnumVariant { "large size difference between variants", |db| { if variant.fields.len() == 1 { - let span = match def.variants[i].node.data { + let span = match def.variants[i].data { VariantData::Struct(ref fields, ..) | VariantData::Tuple(ref fields, ..) => { fields[0].ty.span }, diff --git a/clippy_lints/src/missing_doc.rs b/clippy_lints/src/missing_doc.rs index 7f49a287c..15cbdf718 100644 --- a/clippy_lints/src/missing_doc.rs +++ b/clippy_lints/src/missing_doc.rs @@ -197,6 +197,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { } fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, v: &'tcx hir::Variant, _: &hir::Generics) { - self.check_missing_docs_attrs(cx, &v.node.attrs, v.span, "a variant"); + self.check_missing_docs_attrs(cx, &v.attrs, v.span, "a variant"); } } diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index 811bdce18..6d9eddac8 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -91,7 +91,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Author { } fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, var: &'tcx hir::Variant, generics: &hir::Generics) { - if !has_attr(cx.sess(), &var.node.attrs) { + if !has_attr(cx.sess(), &var.attrs) { return; } prelude();