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