|
| 1 | +error: trailing zero-sized array in a struct which is not marked with a `repr` attribute |
| 2 | + --> $DIR/trailing_zero_sized_array_without_repr.rs:6:1 |
| 3 | + | |
| 4 | +LL | / struct RarelyUseful { |
| 5 | +LL | | field: i32, |
| 6 | +LL | | last: [usize; 0], |
| 7 | +LL | | } |
| 8 | + | |_^ |
| 9 | + | |
| 10 | + = 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 |
| 12 | + |
| 13 | +error: trailing zero-sized array in a struct which is not marked with a `repr` attribute |
| 14 | + --> $DIR/trailing_zero_sized_array_without_repr.rs:11:1 |
| 15 | + | |
| 16 | +LL | / struct OnlyField { |
| 17 | +LL | | first_and_last: [usize; 0], |
| 18 | +LL | | } |
| 19 | + | |_^ |
| 20 | + | |
| 21 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 22 | + |
| 23 | +error: trailing zero-sized array in a struct which is not marked with a `repr` attribute |
| 24 | + --> $DIR/trailing_zero_sized_array_without_repr.rs:15:1 |
| 25 | + | |
| 26 | +LL | / struct GenericArrayType<T> { |
| 27 | +LL | | field: i32, |
| 28 | +LL | | last: [T; 0], |
| 29 | +LL | | } |
| 30 | + | |_^ |
| 31 | + | |
| 32 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 33 | + |
| 34 | +error: 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 |
| 36 | + | |
| 37 | +LL | / #[must_use] |
| 38 | +LL | | struct OnlyAnotherAttributeMustUse { |
| 39 | +LL | | field: i32, |
| 40 | +LL | | last: [usize; 0], |
| 41 | +LL | | } |
| 42 | + | |_^ |
| 43 | + | |
| 44 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 45 | + |
| 46 | +error: trailing zero-sized array in a struct which is not marked with a `repr` attribute |
| 47 | + --> $DIR/trailing_zero_sized_array_without_repr.rs:29:1 |
| 48 | + | |
| 49 | +LL | / struct OnlyAnotherAttributeDerive { |
| 50 | +LL | | field: i32, |
| 51 | +LL | | last: [usize; 0], |
| 52 | +LL | | } |
| 53 | + | |_^ |
| 54 | + | |
| 55 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 56 | + |
| 57 | +error: trailing zero-sized array in a struct which is not marked with a `repr` attribute |
| 58 | + --> $DIR/trailing_zero_sized_array_without_repr.rs:35:1 |
| 59 | + | |
| 60 | +LL | / struct ZeroSizedWithConst { |
| 61 | +LL | | field: i32, |
| 62 | +LL | | last: [usize; ZERO], |
| 63 | +LL | | } |
| 64 | + | |_^ |
| 65 | + | |
| 66 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 67 | + |
| 68 | +error: trailing zero-sized array in a struct which is not marked with a `repr` attribute |
| 69 | + --> $DIR/trailing_zero_sized_array_without_repr.rs:44:1 |
| 70 | + | |
| 71 | +LL | / struct ZeroSizedWithConstFunction { |
| 72 | +LL | | field: i32, |
| 73 | +LL | | last: [usize; compute_zero()], |
| 74 | +LL | | } |
| 75 | + | |_^ |
| 76 | + | |
| 77 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 78 | + |
| 79 | +error: 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 |
| 81 | + | |
| 82 | +LL | struct ZeroSizedArrayWrapper([usize; 0]); |
| 83 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 84 | + | |
| 85 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 86 | + |
| 87 | +error: 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 |
| 89 | + | |
| 90 | +LL | struct TupleStruct(i32, [usize; 0]); |
| 91 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 92 | + | |
| 93 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 94 | + |
| 95 | +error: 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 |
| 97 | + | |
| 98 | +LL | / struct LotsOfFields { |
| 99 | +LL | | f1: u32, |
| 100 | +LL | | f2: u32, |
| 101 | +LL | | f3: u32, |
| 102 | +... | |
| 103 | +LL | | last: [usize; 0], |
| 104 | +LL | | } |
| 105 | + | |_^ |
| 106 | + | |
| 107 | + = help: consider annotating the struct definition with `#[repr(C)]` or another `repr` attribute |
| 108 | + |
| 109 | +error: aborting due to 10 previous errors |
| 110 | + |
0 commit comments