@@ -8,8 +8,8 @@ LL | let a = [f(); 0];
88 = help: to override `-D warnings` add `#[allow(clippy::zero_repeat_side_effects)]`
99help: consider performing the side effect separately
1010 |
11- LL - let a = [ f(); 0] ;
12- LL + f(); let a: [i32; 0] = [];
11+ LL ~ f();
12+ LL + let a: [i32; 0] = [];
1313 |
1414
1515error: expression with side effects as the initial value in a zero-sized array initializer
@@ -20,8 +20,8 @@ LL | b = [f(); 0];
2020 |
2121help: consider performing the side effect separately
2222 |
23- LL - b = [ f(); 0] ;
24- LL + f(); b = [] as [i32; 0];
23+ LL ~ f();
24+ LL ~ b = [] as [i32; 0];
2525 |
2626
2727error: expression with side effects as the initial value in a zero-sized array initializer
@@ -32,8 +32,8 @@ LL | let c = vec![f(); 0];
3232 |
3333help: consider performing the side effect separately
3434 |
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![];
3737 |
3838
3939error: expression with side effects as the initial value in a zero-sized array initializer
@@ -44,8 +44,8 @@ LL | d = vec![f(); 0];
4444 |
4545help: consider performing the side effect separately
4646 |
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>;
4949 |
5050
5151error: 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];
5656 |
5757help: consider performing the side effect separately
5858 |
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] = [];
6161 |
6262
6363error: expression with side effects as the initial value in a zero-sized array initializer
@@ -68,8 +68,8 @@ LL | let g = [{ f() }; 0];
6868 |
6969help: consider performing the side effect separately
7070 |
71- LL - let g = [ { f() }; 0] ;
72- LL + { f() }; let g: [i32; 0] = [];
71+ LL ~ { f() };
72+ LL + let g: [i32; 0] = [];
7373 |
7474
7575error: expression with side effects as the initial value in a zero-sized array initializer
@@ -80,8 +80,10 @@ LL | drop(vec![f(); 0]);
8080 |
8181help: consider performing the side effect separately
8282 |
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 ~ });
8587 |
8688
8789error: expression with side effects as the initial value in a zero-sized array initializer
@@ -92,8 +94,10 @@ LL | vec![f(); 0];
9294 |
9395help: consider performing the side effect separately
9496 |
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 ~ };
97101 |
98102
99103error: expression with side effects as the initial value in a zero-sized array initializer
@@ -104,8 +108,10 @@ LL | [f(); 0];
104108 |
105109help: consider performing the side effect separately
106110 |
107- LL - [f(); 0];
108- LL + { f(); [] as [i32; 0] };
111+ LL ~ {
112+ LL + f();
113+ LL + [] as [i32; 0]
114+ LL ~ };
109115 |
110116
111117error: expression with side effects as the initial value in a zero-sized array initializer
@@ -116,8 +122,10 @@ LL | foo(&[Some(f()); 0]);
116122 |
117123help: consider performing the side effect separately
118124 |
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 ~ });
121129 |
122130
123131error: 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]);
128136 |
129137help: consider performing the side effect separately
130138 |
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 ~ });
133143 |
134144
135145error: aborting due to 11 previous errors
0 commit comments