Yep thanks, but it does error with a sensible message:
fn main() {
assert!(0 <= 2_147_483_648);
}
Errors:
Compiling playground v0.0.1 (/playground)
error: literal out of range for `i32`
--> src/main.rs:4:18
|
4 | assert!(0 <= 2_147_483_648);
| ^^^^^^^^^^^^^
|
= note: the literal `2_147_483_648` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
= help: consider using the type `u32` instead
= note: `#[deny(overflowing_literals)]` on by default
error: could not compile `playground` (bin "playground") due to 1 previous error
Anyways, I thought it would be reasonable to expect type inference to work a usual..
pub struct InferType {
value: i64,
}
fn main() {
let value = 2_147_483_648;
assert!(0 <= value);
let _ = InferType { value };
}