@@ -8,8 +8,8 @@ LL | let a = [f(); 0];
8
8
= help: to override `-D warnings` add `#[allow(clippy::zero_repeat_side_effects)]`
9
9
help: consider performing the side effect separately
10
10
|
11
- LL - let a = [ f(); 0] ;
12
- LL + f(); let a: [i32; 0] = [];
11
+ LL ~ f();
12
+ LL + let a: [i32; 0] = [];
13
13
|
14
14
15
15
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -20,8 +20,8 @@ LL | b = [f(); 0];
20
20
|
21
21
help: consider performing the side effect separately
22
22
|
23
- LL - b = [ f(); 0] ;
24
- LL + f(); b = [] as [i32; 0];
23
+ LL ~ f();
24
+ LL ~ b = [] as [i32; 0];
25
25
|
26
26
27
27
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -32,8 +32,8 @@ LL | let c = vec![f(); 0];
32
32
|
33
33
help: consider performing the side effect separately
34
34
|
35
- LL - let c = vec![ f(); 0] ;
36
- LL + f(); let c: std::vec::Vec<i32> = vec![];
35
+ LL ~ f();
36
+ LL + let c: std::vec::Vec<i32> = vec![];
37
37
|
38
38
39
39
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -44,8 +44,8 @@ LL | d = vec![f(); 0];
44
44
|
45
45
help: consider performing the side effect separately
46
46
|
47
- LL - d = vec![ f(); 0] ;
48
- LL + f(); d = vec![] as std::vec::Vec<i32>;
47
+ LL ~ f();
48
+ LL ~ d = vec![] as std::vec::Vec<i32>;
49
49
|
50
50
51
51
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -56,8 +56,8 @@ LL | let e = [println!("side effect"); 0];
56
56
|
57
57
help: consider performing the side effect separately
58
58
|
59
- LL - let e = [ println!("side effect"); 0] ;
60
- LL + println!("side effect"); let e: [(); 0] = [];
59
+ LL ~ println!("side effect");
60
+ LL + let e: [(); 0] = [];
61
61
|
62
62
63
63
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -68,8 +68,8 @@ LL | let g = [{ f() }; 0];
68
68
|
69
69
help: consider performing the side effect separately
70
70
|
71
- LL - let g = [ { f() }; 0] ;
72
- LL + { f() }; let g: [i32; 0] = [];
71
+ LL ~ { f() };
72
+ LL + let g: [i32; 0] = [];
73
73
|
74
74
75
75
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -80,8 +80,10 @@ LL | drop(vec![f(); 0]);
80
80
|
81
81
help: consider performing the side effect separately
82
82
|
83
- LL - drop(vec![f(); 0]);
84
- LL + drop({ f(); vec![] as std::vec::Vec<i32> });
83
+ LL ~ drop({
84
+ LL + f();
85
+ LL + vec![] as std::vec::Vec<i32>
86
+ LL ~ });
85
87
|
86
88
87
89
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -92,8 +94,10 @@ LL | vec![f(); 0];
92
94
|
93
95
help: consider performing the side effect separately
94
96
|
95
- LL - vec![f(); 0];
96
- LL + { f(); vec![] as std::vec::Vec<i32> };
97
+ LL ~ {
98
+ LL + f();
99
+ LL + vec![] as std::vec::Vec<i32>
100
+ LL ~ };
97
101
|
98
102
99
103
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -104,8 +108,10 @@ LL | [f(); 0];
104
108
|
105
109
help: consider performing the side effect separately
106
110
|
107
- LL - [f(); 0];
108
- LL + { f(); [] as [i32; 0] };
111
+ LL ~ {
112
+ LL + f();
113
+ LL + [] as [i32; 0]
114
+ LL ~ };
109
115
|
110
116
111
117
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -116,8 +122,10 @@ LL | foo(&[Some(f()); 0]);
116
122
|
117
123
help: consider performing the side effect separately
118
124
|
119
- LL - foo(&[Some(f()); 0]);
120
- LL + foo(&{ Some(f()); [] as [std::option::Option<i32>; 0] });
125
+ LL ~ foo(&{
126
+ LL + Some(f());
127
+ LL + [] as [std::option::Option<i32>; 0]
128
+ LL ~ });
121
129
|
122
130
123
131
error: expression with side effects as the initial value in a zero-sized array initializer
@@ -128,8 +136,10 @@ LL | foo(&[Some(Some(S::new())); 0]);
128
136
|
129
137
help: consider performing the side effect separately
130
138
|
131
- LL - foo(&[Some(Some(S::new())); 0]);
132
- LL + foo(&{ Some(Some(S::new())); [] as [std::option::Option<std::option::Option<S>>; 0] });
139
+ LL ~ foo(&{
140
+ LL + Some(Some(S::new()));
141
+ LL + [] as [std::option::Option<std::option::Option<S>>; 0]
142
+ LL ~ });
133
143
|
134
144
135
145
error: aborting due to 11 previous errors
0 commit comments