let _ = (0 = 0) //~ ERROR mismatched types [E0308]
&& { 0 = 0 } //~ ERROR mismatched types [E0308]
|| (0 = 0); //~ ERROR mismatched types [E0308]
+
+ // A test to check that not expecting `bool` behaves well:
+ let _: usize = 0 = 0;
+ //~^ ERROR mismatched types [E0308]
+ //~| ERROR invalid left-hand side expression [E0070]
}
= note: expected type `bool`
found type `()`
-error: aborting due to 11 previous errors
+error[E0070]: invalid left-hand side expression
+ --> $DIR/assignment-expected-bool.rs:31:20
+ |
+LL | let _: usize = 0 = 0;
+ | ^^^^^ left-hand of expression not valid
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-expected-bool.rs:31:20
+ |
+LL | let _: usize = 0 = 0;
+ | ^^^^^ expected usize, found ()
+ |
+ = note: expected type `usize`
+ found type `()`
+
+error: aborting due to 13 previous errors
-For more information about this error, try `rustc --explain E0308`.
+Some errors occurred: E0070, E0308.
+For more information about an error, try `rustc --explain E0070`.