diff --git a/src/types.rs b/src/types.rs index 584f9b34988..af2deb9aa97 100644 --- a/src/types.rs +++ b/src/types.rs @@ -285,9 +285,9 @@ impl LateLintPass for TypeComplexityPass { fn check_variant(&mut self, cx: &LateContext, var: &Variant, _: &Generics) { // StructVariant is covered by check_struct_field - if let TupleVariantKind(ref args) = var.node.kind { + if let VariantData::Tuple(ref args, _) = *var.node.data { for arg in args { - check_type(cx, &arg.ty); + check_type(cx, &arg.node.ty); } } } diff --git a/tests/compile-fail/complex_types.rs b/tests/compile-fail/complex_types.rs index 995132ba88c..f5b21c6df4b 100755 --- a/tests/compile-fail/complex_types.rs +++ b/tests/compile-fail/complex_types.rs @@ -17,6 +17,7 @@ struct TS(Vec>>); //~ERROR very complex type enum E { V1(Vec>>), //~ERROR very complex type + //~^ERROR very complex type V2 { f: Vec>> }, //~ERROR very complex type }