88 | |_^
99 |
1010 = note: `-D clippy::trailing-zero-sized-array-without-repr` implied by `-D warnings`
11- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
11+ = help: consider annotating `RarelyUseful` with `#[repr(C)]` or another `repr` attribute
1212
1313error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
1414 --> $DIR/trailing_zero_sized_array_without_repr.rs:11:1
@@ -18,7 +18,7 @@ LL | | first_and_last: [usize; 0],
1818LL | | }
1919 | |_^
2020 |
21- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
21+ = help: consider annotating `OnlyField` with `#[repr(C)]` or another `repr` attribute
2222
2323error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2424 --> $DIR/trailing_zero_sized_array_without_repr.rs:15:1
@@ -29,19 +29,18 @@ LL | | last: [T; 0],
2929LL | | }
3030 | |_^
3131 |
32- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
32+ = help: consider annotating `GenericArrayType` with `#[repr(C)]` or another `repr` attribute
3333
3434error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
35- --> $DIR/trailing_zero_sized_array_without_repr.rs:20 :1
35+ --> $DIR/trailing_zero_sized_array_without_repr.rs:21 :1
3636 |
37- LL | / #[must_use]
38- LL | | struct OnlyAnotherAttribute {
37+ LL | / struct OnlyAnotherAttribute {
3938LL | | field: i32,
4039LL | | last: [usize; 0],
4140LL | | }
4241 | |_^
4342 |
44- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
43+ = help: consider annotating `OnlyAnotherAttribute` with `#[repr(C)]` or another `repr` attribute
4544
4645error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
4746 --> $DIR/trailing_zero_sized_array_without_repr.rs:29:1
@@ -52,7 +51,7 @@ LL | | last: [usize; 0],
5251LL | | }
5352 | |_^
5453 |
55- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
54+ = help: consider annotating `OnlyADeriveAttribute` with `#[repr(C)]` or another `repr` attribute
5655
5756error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
5857 --> $DIR/trailing_zero_sized_array_without_repr.rs:35:1
@@ -63,7 +62,7 @@ LL | | last: [usize; ZERO],
6362LL | | }
6463 | |_^
6564 |
66- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
65+ = help: consider annotating `ZeroSizedWithConst` with `#[repr(C)]` or another `repr` attribute
6766
6867error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
6968 --> $DIR/trailing_zero_sized_array_without_repr.rs:44:1
@@ -74,26 +73,37 @@ LL | | last: [usize; compute_zero()],
7473LL | | }
7574 | |_^
7675 |
77- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
76+ = help: consider annotating `ZeroSizedWithConstFunction` with `#[repr(C)]` or another `repr` attribute
7877
7978error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
80- --> $DIR/trailing_zero_sized_array_without_repr.rs:49:1
79+ --> $DIR/trailing_zero_sized_array_without_repr.rs:52:1
80+ |
81+ LL | / struct ZeroSizedWithConstFunction2 {
82+ LL | | field: i32,
83+ LL | | last: [usize; compute_zero_from_arg(1)],
84+ LL | | }
85+ | |_^
86+ |
87+ = help: consider annotating `ZeroSizedWithConstFunction2` with `#[repr(C)]` or another `repr` attribute
88+
89+ error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
90+ --> $DIR/trailing_zero_sized_array_without_repr.rs:57:1
8191 |
8292LL | struct ZeroSizedArrayWrapper([usize; 0]);
8393 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8494 |
85- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
95+ = help: consider annotating `ZeroSizedArrayWrapper` with `#[repr(C)]` or another `repr` attribute
8696
8797error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
88- --> $DIR/trailing_zero_sized_array_without_repr.rs:51 :1
98+ --> $DIR/trailing_zero_sized_array_without_repr.rs:59 :1
8999 |
90100LL | struct TupleStruct(i32, [usize; 0]);
91101 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92102 |
93- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
103+ = help: consider annotating `TupleStruct` with `#[repr(C)]` or another `repr` attribute
94104
95105error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
96- --> $DIR/trailing_zero_sized_array_without_repr.rs:53 :1
106+ --> $DIR/trailing_zero_sized_array_without_repr.rs:61 :1
97107 |
98108LL | / struct LotsOfFields {
99109LL | | f1: u32,
@@ -104,7 +114,7 @@ LL | | last: [usize; 0],
104114LL | | }
105115 | |_^
106116 |
107- = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute
117+ = help: consider annotating `LotsOfFields` with `#[repr(C)]` or another `repr` attribute
108118
109- error: aborting due to 10 previous errors
119+ error: aborting due to 11 previous errors
110120
0 commit comments