Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Aug 15, 2019
1 parent d829d9f commit 9533fa5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions clippy_lints/src/enum_clike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/enum_variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/large_enum_variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/missing_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9533fa5

Please sign in to comment.