| |
| expected bool, found ()
| help: try comparing for equality: `x == x`
- |
- = note: expected type `bool`
- found type `()`
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:20:8
| |
| expected bool, found ()
| help: try comparing for equality: `x == x`
- |
- = note: expected type `bool`
- found type `()`
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:25:8
| |
| expected bool, found ()
| help: try comparing for equality: `y == (Foo { foo: x })`
- |
- = note: expected type `bool`
- found type `()`
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:30:8
| |
| expected bool, found ()
| help: try comparing for equality: `3 == x`
- |
- = note: expected type `bool`
- found type `()`
error[E0308]: mismatched types
- --> $DIR/assignment-in-if.rs:34:8
+ --> $DIR/assignment-in-if.rs:36:13
|
-LL | if (if true { x = 4 } else { x = 5 }) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found ()
+LL | x = 4
+ | ^^^^^
+ | |
+ | expected bool, found ()
+ | help: try comparing for equality: `x == 4`
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:38:13
|
- = note: expected type `bool`
- found type `()`
+LL | x = 5
+ | ^^^^^
+ | |
+ | expected bool, found ()
+ | help: try comparing for equality: `x == 5`
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0308`.