mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 23:03:06 +03:00
87d8f5885b
- On `const` and `static` point at the type (like we do for let bindings) - On fn calls, point at const parameter in fn definition - On type, point at const parameter in type definition - On array type lengths, explain that array length is always `usize` - On enum variant discriminant, mention `repr`
132 lines
4.0 KiB
Plaintext
132 lines
4.0 KiB
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:1:18
|
|
|
|
|
LL | const X: usize = 42 && 39;
|
|
| ^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:1:24
|
|
|
|
|
LL | const X: usize = 42 && 39;
|
|
| ^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:1:18
|
|
|
|
|
LL | const X: usize = 42 && 39;
|
|
| ----- ^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:11:19
|
|
|
|
|
LL | const X1: usize = 42 || 39;
|
|
| ^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:11:25
|
|
|
|
|
LL | const X1: usize = 42 || 39;
|
|
| ^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:11:19
|
|
|
|
|
LL | const X1: usize = 42 || 39;
|
|
| ----- ^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:21:19
|
|
|
|
|
LL | const X2: usize = -42 || -39;
|
|
| ^^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:21:26
|
|
|
|
|
LL | const X2: usize = -42 || -39;
|
|
| ^^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:21:19
|
|
|
|
|
LL | const X2: usize = -42 || -39;
|
|
| ----- ^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:31:19
|
|
|
|
|
LL | const X3: usize = -42 && -39;
|
|
| ^^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:31:26
|
|
|
|
|
LL | const X3: usize = -42 && -39;
|
|
| ^^^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:31:19
|
|
|
|
|
LL | const X3: usize = -42 && -39;
|
|
| ----- ^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:41:18
|
|
|
|
|
LL | const Y: usize = 42.0 == 42.0;
|
|
| ----- ^^^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:47:19
|
|
|
|
|
LL | const Y1: usize = 42.0 >= 42.0;
|
|
| ----- ^^^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:53:19
|
|
|
|
|
LL | const Y2: usize = 42.0 <= 42.0;
|
|
| ----- ^^^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:59:19
|
|
|
|
|
LL | const Y3: usize = 42.0 > 42.0;
|
|
| ----- ^^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:65:19
|
|
|
|
|
LL | const Y4: usize = 42.0 < 42.0;
|
|
| ----- ^^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/const-integer-bool-ops.rs:71:19
|
|
|
|
|
LL | const Y5: usize = 42.0 != 42.0;
|
|
| ----- ^^^^^^^^^^^^ expected `usize`, found `bool`
|
|
| |
|
|
| expected because of the type of the constant
|
|
|
|
error: aborting due to 18 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|