1 error[E0308]: mismatched types
2 --> $DIR/assignment-in-if.rs:15:8
7 | expected bool, found ()
8 | help: try comparing for equality: `x == x`
10 = note: expected type `bool`
13 error[E0308]: mismatched types
14 --> $DIR/assignment-in-if.rs:20:8
19 | expected bool, found ()
20 | help: try comparing for equality: `x == x`
22 = note: expected type `bool`
25 error[E0308]: mismatched types
26 --> $DIR/assignment-in-if.rs:25:8
28 LL | if y = (Foo { foo: x }) {
29 | ^^^^^^^^^^^^^^^^^^^^
31 | expected bool, found ()
32 | help: try comparing for equality: `y == (Foo { foo: x })`
34 = note: expected type `bool`
37 error[E0308]: mismatched types
38 --> $DIR/assignment-in-if.rs:30:8
43 | expected bool, found ()
44 | help: try comparing for equality: `3 == x`
46 = note: expected type `bool`
49 error[E0308]: mismatched types
50 --> $DIR/assignment-in-if.rs:34:8
52 LL | if (if true { x = 4 } else { x = 5 }) {
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found ()
55 = note: expected type `bool`
58 error: aborting due to 5 previous errors
60 For more information about this error, try `rustc --explain E0308`.