about summary refs log tree commit diff
path: root/tests/ui/trailing_empty_array.rs
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2023-08-24 21:04:57 +0200
committerPhilipp Krones <hello@philkrones.com>2023-08-24 21:04:57 +0200
commitef4d64f1bd3f2a5693f062136f8411ac641bece8 (patch)
tree386b8d0068d4b23d23f2a0ba5f8ee052dfc566a0 /tests/ui/trailing_empty_array.rs
parent32eecd4b884dd2901aad05d66d78ea643a896e25 (diff)
parentdf68b713270775364dc286eaec1c48fd14ae50e4 (diff)
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'tests/ui/trailing_empty_array.rs')
-rw-r--r--tests/ui/trailing_empty_array.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/trailing_empty_array.rs b/tests/ui/trailing_empty_array.rs
index 928475b5f35..3d06c262168 100644
--- a/tests/ui/trailing_empty_array.rs
+++ b/tests/ui/trailing_empty_array.rs
@@ -3,33 +3,39 @@
 // Do lint:
 
 struct RarelyUseful {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     field: i32,
     last: [usize; 0],
 }
 
 struct OnlyField {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     first_and_last: [usize; 0],
 }
 
 struct GenericArrayType<T> {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     field: i32,
     last: [T; 0],
 }
 
 #[must_use]
 struct OnlyAnotherAttribute {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     field: i32,
     last: [usize; 0],
 }
 
 #[derive(Debug)]
 struct OnlyADeriveAttribute {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     field: i32,
     last: [usize; 0],
 }
 
 const ZERO: usize = 0;
 struct ZeroSizedWithConst {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     field: i32,
     last: [usize; ZERO],
 }
@@ -39,6 +45,7 @@ const fn compute_zero() -> usize {
     (4 + 6) - (2 * 5)
 }
 struct ZeroSizedWithConstFunction {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     field: i32,
     last: [usize; compute_zero()],
 }
@@ -47,15 +54,19 @@ const fn compute_zero_from_arg(x: usize) -> usize {
     x - 1
 }
 struct ZeroSizedWithConstFunction2 {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     field: i32,
     last: [usize; compute_zero_from_arg(1)],
 }
 
 struct ZeroSizedArrayWrapper([usize; 0]);
+//~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
 
 struct TupleStruct(i32, [usize; 0]);
+//~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
 
 struct LotsOfFields {
+    //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib
     f1: u32,
     f2: u32,
     f3: u32,