rust/tests/ui/type/type-check/assignment-expected-bool.st...

153 lines
3.8 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:6:19
|
LL | let _: bool = 0 = 0;
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | let _: bool = 0 == 0;
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:9:14
|
LL | 0 => 0 = 0,
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | 0 => 0 == 0,
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:10:14
|
LL | _ => 0 = 0,
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | _ => 0 == 0,
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:14:17
|
LL | true => 0 = 0,
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | true => 0 == 0,
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:18:8
|
LL | if 0 = 0 {}
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | if 0 == 0 {}
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:20:24
|
LL | let _: bool = if { 0 = 0 } {
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | let _: bool = if { 0 == 0 } {
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:21:9
|
LL | 0 = 0
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | 0 == 0
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:23:9
|
LL | 0 = 0
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | 0 == 0
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:26:13
|
LL | let _ = (0 = 0)
| ^^^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | let _ = (0 == 0)
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:27:14
|
LL | && { 0 = 0 }
| ^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | && { 0 == 0 }
| +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:28:12
|
LL | || (0 = 0);
| ^^^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | || (0 == 0);
| +
error[E0070]: invalid left-hand side of assignment
--> $DIR/assignment-expected-bool.rs:31:22
|
LL | let _: usize = 0 = 0;
| - ^
| |
| cannot assign to this expression
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:31:20
|
LL | let _: usize = 0 = 0;
| ----- ^^^^^ expected `usize`, found `()`
| |
| expected due to this
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:37:8
|
LL | if foo = bar {}
| ^^^^^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | if foo == bar {}
| +
error: aborting due to 14 previous errors
Some errors have detailed explanations: E0070, E0308.
For more information about an error, try `rustc --explain E0070`.