2021-10-21 06:11:36 -05:00
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2021-12-12 06:34:21 -06:00
|
|
|
--> $DIR/trailing_empty_array.rs:5:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct RarelyUseful {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [usize; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `RarelyUseful` with `#[repr(C)]` or another `repr` attribute
|
2022-09-22 11:04:22 -05:00
|
|
|
= note: `-D clippy::trailing-empty-array` implied by `-D warnings`
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:11:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct OnlyField {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | first_and_last: [usize; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `OnlyField` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:16:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct GenericArrayType<T> {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [T; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `GenericArrayType` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:23:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct OnlyAnotherAttribute {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [usize; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `OnlyAnotherAttribute` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:30:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct OnlyADeriveAttribute {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [usize; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `OnlyADeriveAttribute` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:37:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct ZeroSizedWithConst {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [usize; ZERO],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `ZeroSizedWithConst` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:47:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct ZeroSizedWithConstFunction {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [usize; compute_zero()],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `ZeroSizedWithConstFunction` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:56:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct ZeroSizedWithConstFunction2 {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [usize; compute_zero_from_arg(1)],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `ZeroSizedWithConstFunction2` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:62:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | struct ZeroSizedArrayWrapper([usize; 0]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider annotating `ZeroSizedArrayWrapper` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:65:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | struct TupleStruct(i32, [usize; 0]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider annotating `TupleStruct` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2023-07-28 14:35:48 -05:00
|
|
|
--> $DIR/trailing_empty_array.rs:68:1
|
2021-10-21 06:11:36 -05:00
|
|
|
|
|
|
|
|
LL | / struct LotsOfFields {
|
2023-07-28 14:35:48 -05:00
|
|
|
LL | |
|
2021-10-21 06:11:36 -05:00
|
|
|
LL | | f1: u32,
|
|
|
|
LL | | f2: u32,
|
|
|
|
... |
|
|
|
|
LL | | last: [usize; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `LotsOfFields` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
|
|
|
|