2023-12-10 22:46:25 +00:00
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:18:5
|
|
|
|
|
|
|
|
|
LL | let a = [f(); 0];
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: consider using: `f(); let a: [i32; 0] = [];`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::zero-repeat-side-effects` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::zero_repeat_side_effects)]`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:20:5
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | b = [f(); 0];
|
|
|
|
| ^^^^^^^^^^^^ help: consider using: `f(); b = [] as [i32; 0]`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:24:5
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | let c = vec![f(); 0];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f(); let c: std::vec::Vec<i32> = vec![];`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:26:5
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | d = vec![f(); 0];
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: consider using: `f(); d = vec![] as std::vec::Vec<i32>`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:29:5
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | let e = [println!("side effect"); 0];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `println!("side effect"); let e: [(); 0] = [];`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:32:5
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | let g = [{ f() }; 0];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `{ f() }; let g: [i32; 0] = [];`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:35:10
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | drop(vec![f(); 0]);
|
|
|
|
| ^^^^^^^^^^^^ help: consider using: `{ f(); vec![] as std::vec::Vec<i32> }`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:38:5
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | vec![f(); 0];
|
|
|
|
| ^^^^^^^^^^^^ help: consider using: `{ f(); vec![] as std::vec::Vec<i32> }`
|
|
|
|
|
|
|
|
error: function or method calls as the initial value in zero-sized array initializers may cause side effects
|
2024-07-18 05:22:08 +00:00
|
|
|
--> tests/ui/zero_repeat_side_effects.rs:39:5
|
2023-12-10 22:46:25 +00:00
|
|
|
|
|
|
|
|
LL | [f(); 0];
|
|
|
|
| ^^^^^^^^ help: consider using: `{ f(); [] as [i32; 0] }`
|
|
|
|
|
2024-07-18 05:22:08 +00:00
|
|
|
error: aborting due to 9 previous errors
|
2023-12-10 22:46:25 +00:00
|
|
|
|