]> git.lizzy.rs Git - rust.git/blob - tests/ui/let_if_seq.stderr
Merge pull request #1747 from Manishearth/mut_fp
[rust.git] / tests / ui / let_if_seq.stderr
1 error: `if _ { .. } else { .. }` is an expression
2   --> $DIR/let_if_seq.rs:57:5
3    |
4 57 | /     let mut foo = 0;
5 58 | |     if f() {
6 59 | |         foo = 42;
7 60 | |     }
8    | |_____^ help: it is more idiomatic to write `let <mut> foo = if f() { 42 } else { 0 };`
9    |
10 note: lint level defined here
11   --> $DIR/let_if_seq.rs:5:9
12    |
13 5  | #![deny(useless_let_if_seq)]
14    |         ^^^^^^^^^^^^^^^^^^
15    = note: you might not need `mut` at all
16
17 error: `if _ { .. } else { .. }` is an expression
18   --> $DIR/let_if_seq.rs:62:5
19    |
20 62 | /     let mut bar = 0;
21 63 | |     if f() {
22 64 | |         f();
23 65 | |         bar = 42;
24 ...  |
25 68 | |         f();
26 69 | |     }
27    | |_____^ help: it is more idiomatic to write `let <mut> bar = if f() { ..; 42 } else { ..; 0 };`
28    |
29    = note: you might not need `mut` at all
30
31 error: `if _ { .. } else { .. }` is an expression
32   --> $DIR/let_if_seq.rs:71:5
33    |
34 71 | /     let quz;
35 72 | |     if f() {
36 73 | |         quz = 42;
37 74 | |     } else {
38 75 | |         quz = 0;
39 76 | |     }
40    | |_____^ help: it is more idiomatic to write `let quz = if f() { 42 } else { 0 };`
41
42 error: `if _ { .. } else { .. }` is an expression
43    --> $DIR/let_if_seq.rs:100:5
44     |
45 100 | /     let mut baz = 0;
46 101 | |     if f() {
47 102 | |         baz = 42;
48 103 | |     }
49     | |_____^ help: it is more idiomatic to write `let <mut> baz = if f() { 42 } else { 0 };`
50     |
51     = note: you might not need `mut` at all
52
53 error: aborting due to 4 previous errors
54