]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/let_if_seq.stderr
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / let_if_seq.stderr
CommitLineData
f20569fa
XL
1error: `if _ { .. } else { .. }` is an expression
2 --> $DIR/let_if_seq.rs:64:5
3 |
4LL | / let mut foo = 0;
5LL | | if f() {
6LL | | foo = 42;
7LL | | }
8 | |_____^ help: it is more idiomatic to write: `let <mut> foo = if f() { 42 } else { 0 };`
9 |
10 = note: `-D clippy::useless-let-if-seq` implied by `-D warnings`
11 = note: you might not need `mut` at all
12
13error: `if _ { .. } else { .. }` is an expression
14 --> $DIR/let_if_seq.rs:69:5
15 |
16LL | / let mut bar = 0;
17LL | | if f() {
18LL | | f();
19LL | | bar = 42;
20LL | | } else {
21LL | | f();
22LL | | }
23 | |_____^ help: it is more idiomatic to write: `let <mut> bar = if f() { ..; 42 } else { ..; 0 };`
24 |
25 = note: you might not need `mut` at all
26
27error: `if _ { .. } else { .. }` is an expression
28 --> $DIR/let_if_seq.rs:77:5
29 |
30LL | / let quz;
31LL | | if f() {
32LL | | quz = 42;
33LL | | } else {
34LL | | quz = 0;
35LL | | }
36 | |_____^ help: it is more idiomatic to write: `let quz = if f() { 42 } else { 0 };`
37
38error: `if _ { .. } else { .. }` is an expression
39 --> $DIR/let_if_seq.rs:106:5
40 |
41LL | / let mut baz = 0;
42LL | | if f() {
43LL | | baz = 42;
44LL | | }
45 | |_____^ help: it is more idiomatic to write: `let <mut> baz = if f() { 42 } else { 0 };`
46 |
47 = note: you might not need `mut` at all
48
49error: aborting due to 4 previous errors
50