From b2f455065401eeb65250815e8ce566239ca69217 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 15 Oct 2015 19:55:14 +0530 Subject: [PATCH] Fix type complexity lint --- src/types.rs | 10 +--------- tests/compile-fail/complex_types.rs | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/types.rs b/src/types.rs index af2deb9aa97..93962586bc6 100644 --- a/src/types.rs +++ b/src/types.rs @@ -280,18 +280,10 @@ fn check_fn(&mut self, cx: &LateContext, _: FnKind, decl: &FnDecl, _: &Block, _: } fn check_struct_field(&mut self, cx: &LateContext, field: &StructField) { + // enum variants are also struct fields now check_type(cx, &field.node.ty); } - fn check_variant(&mut self, cx: &LateContext, var: &Variant, _: &Generics) { - // StructVariant is covered by check_struct_field - if let VariantData::Tuple(ref args, _) = *var.node.data { - for arg in args { - check_type(cx, &arg.node.ty); - } - } - } - fn check_item(&mut self, cx: &LateContext, item: &Item) { match item.node { ItemStatic(ref ty, _, _) | diff --git a/tests/compile-fail/complex_types.rs b/tests/compile-fail/complex_types.rs index f5b21c6df4b..995132ba88c 100755 --- a/tests/compile-fail/complex_types.rs +++ b/tests/compile-fail/complex_types.rs @@ -17,7 +17,6 @@ struct S { enum E { V1(Vec>>), //~ERROR very complex type - //~^ERROR very complex type V2 { f: Vec>> }, //~ERROR very complex type } -- 2.44.0