rust-clippy/tests/ui/trailing_empty_array.stderr

121 lines
3.8 KiB
Text
Raw Normal View History

2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:6:1
2021-10-18 10:52:37 +00:00
|
LL | / struct RarelyUseful {
LL | | field: i32,
LL | | last: [usize; 0],
LL | | }
| |_^
|
2021-10-19 21:33:43 +00:00
= note: `-D clippy::trailing-empty-array` implied by `-D warnings`
2021-10-19 00:41:27 +00:00
= help: consider annotating `RarelyUseful` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:11:1
2021-10-18 10:52:37 +00:00
|
LL | / struct OnlyField {
LL | | first_and_last: [usize; 0],
LL | | }
| |_^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `OnlyField` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:15:1
2021-10-18 10:52:37 +00:00
|
LL | / struct GenericArrayType<T> {
LL | | field: i32,
LL | | last: [T; 0],
LL | | }
| |_^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `GenericArrayType` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:21:1
2021-10-18 10:52:37 +00:00
|
2021-10-19 00:41:27 +00:00
LL | / struct OnlyAnotherAttribute {
2021-10-18 10:52:37 +00:00
LL | | field: i32,
LL | | last: [usize; 0],
LL | | }
| |_^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `OnlyAnotherAttribute` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:27:1
2021-10-18 10:52:37 +00:00
|
2021-10-18 11:59:03 +00:00
LL | / struct OnlyADeriveAttribute {
2021-10-18 10:52:37 +00:00
LL | | field: i32,
LL | | last: [usize; 0],
LL | | }
| |_^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `OnlyADeriveAttribute` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:33:1
2021-10-18 10:52:37 +00:00
|
LL | / struct ZeroSizedWithConst {
LL | | field: i32,
LL | | last: [usize; ZERO],
LL | | }
| |_^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `ZeroSizedWithConst` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:42:1
2021-10-18 10:52:37 +00:00
|
LL | / struct ZeroSizedWithConstFunction {
LL | | field: i32,
LL | | last: [usize; compute_zero()],
LL | | }
| |_^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `ZeroSizedWithConstFunction` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:50:1
2021-10-19 00:41:27 +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-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:55:1
2021-10-18 10:52:37 +00:00
|
LL | struct ZeroSizedArrayWrapper([usize; 0]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `ZeroSizedArrayWrapper` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:57:1
2021-10-18 10:52:37 +00:00
|
LL | struct TupleStruct(i32, [usize; 0]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `TupleStruct` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2021-10-19 21:33:43 +00:00
--> $DIR/trailing_empty_array.rs:59:1
2021-10-18 10:52:37 +00:00
|
LL | / struct LotsOfFields {
LL | | f1: u32,
LL | | f2: u32,
LL | | f3: u32,
... |
LL | | last: [usize; 0],
LL | | }
| |_^
|
2021-10-19 00:41:27 +00:00
= help: consider annotating `LotsOfFields` with `#[repr(C)]` or another `repr` attribute
2021-10-18 10:52:37 +00:00
2021-10-19 00:41:27 +00:00
error: aborting due to 11 previous errors
2021-10-18 10:52:37 +00:00