1 #![warn(clippy::trailing_empty_array)]
11 first_and_last: [usize; 0],
14 struct GenericArrayType<T> {
20 struct OnlyAnotherAttribute {
26 struct OnlyADeriveAttribute {
31 const ZERO: usize = 0;
32 struct ZeroSizedWithConst {
37 #[allow(clippy::eq_op)]
38 const fn compute_zero() -> usize {
41 struct ZeroSizedWithConstFunction {
43 last: [usize; compute_zero()],
46 const fn compute_zero_from_arg(x: usize) -> usize {
49 struct ZeroSizedWithConstFunction2 {
51 last: [usize; compute_zero_from_arg(1)],
54 struct ZeroSizedArrayWrapper([usize; 0]);
56 struct TupleStruct(i32, [usize; 0]);
87 struct OnlyFieldWithReprC {
88 first_and_last: [usize; 0],
91 struct NonZeroSizedArray {
98 zero_sized: [usize; 0],
102 const ONE: usize = 1;
103 struct NonZeroSizedWithConst {
110 struct AlsoADeriveAttribute {
117 struct AlsoAnotherAttribute {
139 #[repr(C, align(64))]
145 // NOTE: because of https://doc.rust-lang.org/stable/reference/type-layout.html#primitive-representation-of-enums-with-fields and I'm not sure when in the compilation pipeline that would happen
147 enum DontLintAnonymousStructsFromDesuraging {
150 C { x: u32, y: [u64; 0] },
154 struct TupleStructReprC(i32, [usize; 0]);
156 type NamedTuple = (i32, [usize; 0]);
158 #[rustfmt::skip] // [rustfmt#4995](https://github.com/rust-lang/rustfmt/issues/4995)
159 struct ConstParamZeroDefault<const N: usize = 0> {
164 struct ConstParamNoDefault<const N: usize> {
170 struct ConstParamNonZeroDefault<const N: usize = 1> {
175 struct TwoGenericParams<T, const N: usize> {
180 type A = ConstParamZeroDefault;
181 type B = ConstParamZeroDefault<0>;
182 type C = ConstParamNoDefault<0>;
183 type D = ConstParamNonZeroDefault<0>;