error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:25:8 | 25 | if x = x { | ^^^^^ | | | help: did you mean to compare equality? `x == x` | expected bool, found () | = note: expected type `bool` found type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:31:8 | 31 | if (x = x) { | ^^^^^^^ | | | help: did you mean to compare equality? `x == x` | expected bool, found () | = note: expected type `bool` found type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:37:8 | 37 | if y = (Foo { foo: x }) { | ^^^^^^^^^^^^^^^^^^^^ | | | help: did you mean to compare equality? `y == (Foo { foo: x })` | expected bool, found () | = note: expected type `bool` found type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:43:8 | 43 | if 3 = x { | ^^^^^ | | | help: did you mean to compare equality? `3 == x` | expected bool, found () | = note: expected type `bool` found type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:48:8 | 48 | if (if true { x = 4 } else { x = 5 }) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found () | = note: expected type `bool` found type `()` error: aborting due to previous error(s)