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