]> git.lizzy.rs Git - rust.git/commitdiff
Fix type complexity lint
authorManish Goregaokar <manishsmail@gmail.com>
Thu, 15 Oct 2015 14:25:14 +0000 (19:55 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 15 Oct 2015 14:25:14 +0000 (19:55 +0530)
src/types.rs
tests/compile-fail/complex_types.rs

index af2deb9aa9720b5baf72e7186bcd75389d432d2b..93962586bc6b21d354f2baec4d565dc641eabe2e 100644 (file)
@@ -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, _, _) |
index f5b21c6df4b1a5375aa3e89c109919a063b7f167..995132ba88c9420961cd2d2cbaa33e8008110dfa 100755 (executable)
@@ -17,7 +17,6 @@ struct S {
 
 enum E {
     V1(Vec<Vec<Box<(u32, u32, u32, u32)>>>), //~ERROR very complex type
-    //~^ERROR very complex type
     V2 { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> }, //~ERROR very complex type
 }