]> git.lizzy.rs Git - rust.git/blob - tests/ui/let_if_seq.stderr
Update tests to new format of multiline errors
[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    | |_____^
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 help: it is more idiomatic to write
19    |     let <mut> foo = if f() { 42 } else { 0 };
20    = note: you might not need `mut` at all
21
22 error: `if _ { .. } else { .. }` is an expression
23   --> $DIR/let_if_seq.rs:65:5
24    |
25 65 | /     let mut bar = 0;
26 66 | |
27 67 | |
28 68 | |
29 ...  |
30 74 | |         f();
31 75 | |     }
32    | |_____^
33    |
34 help: it is more idiomatic to write
35    |     let <mut> bar = if f() { ..; 42 } else { ..; 0 };
36    = note: you might not need `mut` at all
37
38 error: `if _ { .. } else { .. }` is an expression
39   --> $DIR/let_if_seq.rs:77:5
40    |
41 77 | /     let quz;
42 78 | |
43 79 | |
44 80 | |
45 ...  |
46 85 | |         quz = 0;
47 86 | |     }
48    | |_____^
49    |
50 help: it is more idiomatic to write
51    |     let quz = if f() { 42 } else { 0 };
52
53 error: `if _ { .. } else { .. }` is an expression
54    --> $DIR/let_if_seq.rs:111:5
55     |
56 111 | /     let mut baz = 0;
57 112 | |
58 113 | |
59 114 | |
60 115 | |     if f() {
61 116 | |         baz = 42;
62 117 | |     }
63     | |_____^
64     |
65 help: it is more idiomatic to write
66     |     let <mut> baz = if f() { 42 } else { 0 };
67     = note: you might not need `mut` at all
68
69 error: aborting due to 4 previous errors
70