]> git.lizzy.rs Git - rust.git/blob - tests/ui/let_if_seq.stderr
Merge pull request #1715 from Manishearth/rustup
[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 | |
6 59 | |
7 60 | |
8 61 | |     if f() {
9 62 | |         foo = 42;
10 63 | |     }
11    | |_____^ help: it is more idiomatic to write `let <mut> foo = if f() { 42 } else { 0 };`
12    |
13 note: lint level defined here
14   --> $DIR/let_if_seq.rs:5:9
15    |
16 5  | #![deny(useless_let_if_seq)]
17    |         ^^^^^^^^^^^^^^^^^^
18    = note: you might not need `mut` at all
19
20 error: `if _ { .. } else { .. }` is an expression
21   --> $DIR/let_if_seq.rs:65:5
22    |
23 65 | /     let mut bar = 0;
24 66 | |
25 67 | |
26 68 | |
27 ...  |
28 74 | |         f();
29 75 | |     }
30    | |_____^ help: it is more idiomatic to write `let <mut> bar = if f() { ..; 42 } else { ..; 0 };`
31    |
32    = note: you might not need `mut` at all
33
34 error: `if _ { .. } else { .. }` is an expression
35   --> $DIR/let_if_seq.rs:77:5
36    |
37 77 | /     let quz;
38 78 | |
39 79 | |
40 80 | |
41 ...  |
42 85 | |         quz = 0;
43 86 | |     }
44    | |_____^ help: it is more idiomatic to write `let quz = if f() { 42 } else { 0 };`
45
46 error: `if _ { .. } else { .. }` is an expression
47    --> $DIR/let_if_seq.rs:111:5
48     |
49 111 | /     let mut baz = 0;
50 112 | |
51 113 | |
52 114 | |
53 115 | |     if f() {
54 116 | |         baz = 42;
55 117 | |     }
56     | |_____^ help: it is more idiomatic to write `let <mut> baz = if f() { 42 } else { 0 };`
57     |
58     = note: you might not need `mut` at all
59
60 error: aborting due to 4 previous errors
61