]> git.lizzy.rs Git - rust.git/commitdiff
Update large_enum_variant test
authorOwen Sanchez <pengowen816@gmail.com>
Sat, 11 Feb 2017 04:04:19 +0000 (21:04 -0700)
committerOwen Sanchez <pengowen816@gmail.com>
Sat, 11 Feb 2017 04:04:19 +0000 (21:04 -0700)
tests/ui/large_enum_variant.rs
tests/ui/large_enum_variant.stderr

index 26ba883b1baa6051c801d3af7ddb3ca1ea06725f..8ac7571c1b1f043740e350c9872e73a4429cd72d 100644 (file)
@@ -7,9 +7,7 @@
 
 enum LargeEnum {
     A(i32),
-    B([i32; 8000]), //~ ERROR large size difference between variants
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
-    //~| SUGGESTION Box<[i32; 8000]>
+    B([i32; 8000]),
 }
 
 enum GenericEnumOk<T> {
@@ -20,8 +18,7 @@ enum GenericEnumOk<T> {
 enum GenericEnum2<T> {
     A(i32),
     B([i32; 8000]),
-    C(T, [i32; 8000]), //~ ERROR large size difference between variants
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
+    C(T, [i32; 8000]),
 }
 
 trait SomeTrait {
@@ -29,35 +26,27 @@ trait SomeTrait {
 }
 
 enum LargeEnumGeneric<A: SomeTrait> {
-    Var(A::Item), // regression test, this used to ICE
+    Var(A::Item),
 }
 
 enum LargeEnum2 {
     VariantOk(i32, u32),
-    ContainingLargeEnum(LargeEnum), //~ ERROR large size difference between variants
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
-    //~| SUGGESTION Box<LargeEnum>
+    ContainingLargeEnum(LargeEnum),
 }
 enum LargeEnum3 {
-    ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]), //~ ERROR large size difference between variants
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
+    ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
     VoidVariant,
     StructLikeLittle { x: i32, y: i32 },
 }
 
 enum LargeEnum4 {
     VariantOk(i32, u32),
-    StructLikeLarge { x: [i32; 8000], y: i32 }, //~ ERROR large size difference between variants
-    //~^ HELP consider boxing the large fields to reduce the total size of the enum
+    StructLikeLarge { x: [i32; 8000], y: i32 },
 }
 
 enum LargeEnum5 {
     VariantOk(i32, u32),
-    StructLikeLarge2 { //~ ERROR large size difference between variants
-        x:
-        [i32; 8000] //~ SUGGESTION Box<[i32; 8000]>
-        //~^ HELP consider boxing the large fields to reduce the total size of the enum
-    },
+    StructLikeLarge2 { x: [i32; 8000] },
 }
 
 enum LargeEnumOk {
@@ -65,6 +54,4 @@ enum LargeEnumOk {
     LargeB([i32; 8001]),
 }
 
-fn main() {
-
-}
+fn main() {}
index 77155b6ab5fedeca6bdecd6628d55e318249ddd1..84213003eb70d80036759c7891ef03105b073580 100644 (file)
@@ -1,4 +1,4 @@
-error: large enum variant found
+error: large size difference between variants
   --> $DIR/large_enum_variant.rs:10:5
    |
 10 |     B([i32; 8000]),
@@ -12,73 +12,59 @@ note: lint level defined here
 help: consider boxing the large fields to reduce the total size of the enum
    |     B(Box<[i32; 8000]>),
 
-error: large enum variant found
-  --> $DIR/large_enum_variant.rs:17:5
-   |
-17 |     B([i32; 8000]),
-   |     ^^^^^^^^^^^^^^
-   |
-help: consider boxing the large fields to reduce the total size of the enum
-   |     B(Box<[i32; 8000]>),
-
-error: large enum variant found
+error: large size difference between variants
   --> $DIR/large_enum_variant.rs:21:5
    |
-21 |     D(T, [i32; 8000]),
+21 |     C(T, [i32; 8000]),
    |     ^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
   --> $DIR/large_enum_variant.rs:21:5
    |
-21 |     D(T, [i32; 8000]),
+21 |     C(T, [i32; 8000]),
    |     ^^^^^^^^^^^^^^^^^
 
-error: large enum variant found
-  --> $DIR/large_enum_variant.rs:35:5
+error: large size difference between variants
+  --> $DIR/large_enum_variant.rs:34:5
    |
-35 |     ContainingLargeEnum(LargeEnum),
+34 |     ContainingLargeEnum(LargeEnum),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |     ContainingLargeEnum(Box<LargeEnum>),
 
-error: large enum variant found
-  --> $DIR/large_enum_variant.rs:38:5
+error: large size difference between variants
+  --> $DIR/large_enum_variant.rs:37:5
    |
-38 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
+37 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
-  --> $DIR/large_enum_variant.rs:38:5
+  --> $DIR/large_enum_variant.rs:37:5
    |
-38 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
+37 |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: large enum variant found
-  --> $DIR/large_enum_variant.rs:42:5
+error: large size difference between variants
+  --> $DIR/large_enum_variant.rs:44:5
    |
-42 |     StructLikeLarge { x: [i32; 8000], y: i32 },
+44 |     StructLikeLarge { x: [i32; 8000], y: i32 },
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
-  --> $DIR/large_enum_variant.rs:42:5
+  --> $DIR/large_enum_variant.rs:44:5
    |
-42 |     StructLikeLarge { x: [i32; 8000], y: i32 },
+44 |     StructLikeLarge { x: [i32; 8000], y: i32 },
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: large enum variant found
-  --> $DIR/large_enum_variant.rs:44:5
+error: large size difference between variants
+  --> $DIR/large_enum_variant.rs:49:5
    |
-44 |       StructLikeLarge2 {
-   |  _____^ starting here...
-45 | |         x:
-46 | |         [i32; 8000]
-47 | |
-48 | |     },
-   | |_____^ ...ending here
+49 |     StructLikeLarge2 { x: [i32; 8000] },
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider boxing the large fields to reduce the total size of the enum
-   |         Box<[i32; 8000]>
+   |     StructLikeLarge2 { x: Box<[i32; 8000]> },
 
-error: aborting due to 7 previous errors
+error: aborting due to 6 previous errors