2021-10-21 11:11:36 +00:00
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:5:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct RarelyUseful {
|
|
|
|
LL | | field: i32,
|
|
|
|
LL | | last: [usize; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `RarelyUseful` with `#[repr(C)]` or another `repr` attribute
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::trailing-empty-array` implied by `-D warnings`
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:10:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct OnlyField {
|
|
|
|
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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:14:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct GenericArrayType<T> {
|
|
|
|
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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:20:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct OnlyAnotherAttribute {
|
|
|
|
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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:26:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct OnlyADeriveAttribute {
|
|
|
|
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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:32:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct ZeroSizedWithConst {
|
|
|
|
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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:41:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct ZeroSizedWithConstFunction {
|
|
|
|
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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:49:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct ZeroSizedWithConstFunction2 {
|
|
|
|
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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:54:1
|
2021-10-21 11:11:36 +00: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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:56:1
|
2021-10-21 11:11:36 +00: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
|
2021-12-12 12:34:21 +00:00
|
|
|
--> $DIR/trailing_empty_array.rs:58:1
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | / struct LotsOfFields {
|
|
|
|
LL | | f1: u32,
|
|
|
|
LL | | f2: u32,
|
|
|
|
LL | | f3: u32,
|
|
|
|
... |
|
|
|
|
LL | | last: [usize; 0],
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: consider annotating `LotsOfFields` with `#[repr(C)]` or another `repr` attribute
|
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
|
|
|
|