]> git.lizzy.rs Git - rust.git/blob - tests/ui/let_if_seq.stderr
Auto merge of #8030 - WaffleLapkin:ignore_trait_assoc_types_type_complexity, r=llogiq
[rust.git] / tests / ui / let_if_seq.stderr
1 error: `if _ { .. } else { .. }` is an expression
2   --> $DIR/let_if_seq.rs:66:5
3    |
4 LL | /     let mut foo = 0;
5 LL | |     if f() {
6 LL | |         foo = 42;
7 LL | |     }
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:71:5
15    |
16 LL | /     let mut bar = 0;
17 LL | |     if f() {
18 LL | |         f();
19 LL | |         bar = 42;
20 LL | |     } else {
21 LL | |         f();
22 LL | |     }
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:79:5
29    |
30 LL | /     let quz;
31 LL | |     if f() {
32 LL | |         quz = 42;
33 LL | |     } else {
34 LL | |         quz = 0;
35 LL | |     }
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:108:5
40    |
41 LL | /     let mut baz = 0;
42 LL | |     if f() {
43 LL | |         baz = 42;
44 LL | |     }
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