fn main() {
let a = 10;
let b : i64 = a;
let c : i32 = a;
}
error[E0308]: mismatched types
--> main.rs:4:17
|
4 | let c : i32 = a;
| --- ^ expected `i32`, found `i64`
| |
| expected due to this
|
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
4 | let c : i32 = a.try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
exit status 1
fn main() {
let a = 10;
let b : i32 = a;
let c : i64 = a;
}
error[E0308]: mismatched types
--> main.rs:4:17
|
4 | let c : i64 = a;
| --- ^
| | |
| | expected `i64`, found `i32`
| | help: you can convert an `i32` to `i64`: `a.into()`
| expected due to this
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
exit status 1