]> git.lizzy.rs Git - rust.git/blob - tests/ui/let_if_seq.stderr
Merge pull request #3265 from mikerite/fix-export
[rust.git] / tests / ui / let_if_seq.stderr
1 error: `if _ { .. } else { .. }` is an expression
2   --> $DIR/let_if_seq.rs:67:5
3    |
4 67 | /     let mut foo = 0;
5 68 | |     if f() {
6 69 | |         foo = 42;
7 70 | |     }
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
13 error: `if _ { .. } else { .. }` is an expression
14   --> $DIR/let_if_seq.rs:72:5
15    |
16 72 | /     let mut bar = 0;
17 73 | |     if f() {
18 74 | |         f();
19 75 | |         bar = 42;
20 ...  |
21 78 | |         f();
22 79 | |     }
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
27 error: `if _ { .. } else { .. }` is an expression
28   --> $DIR/let_if_seq.rs:81:5
29    |
30 81 | /     let quz;
31 82 | |     if f() {
32 83 | |         quz = 42;
33 84 | |     } else {
34 85 | |         quz = 0;
35 86 | |     }
36    | |_____^ help: it is more idiomatic to write: `let quz = if f() { 42 } else { 0 };`
37
38 error: `if _ { .. } else { .. }` is an expression
39    --> $DIR/let_if_seq.rs:110:5
40     |
41 110 | /     let mut baz = 0;
42 111 | |     if f() {
43 112 | |         baz = 42;
44 113 | |     }
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
49 error: aborting due to 4 previous errors
50