{integer}- an integer value whose specific type has not been specified and has not yet been inferred by the compiler; following code:
fn main() {
let x = 1;
let () = x;
}
Will result in the following error:
error[E0308]: mismatched types
--> <anon>:3:9
|
3 | let () = x;
| ^^ expected integral variable, found ()
|
= note: expected type `{integer}`
= note: found type `()`
The same thing will happen with a floating number:
fn main() {
let x = 1.0;
let () = x;
}
error[E0308]: mismatched types
--> <anon>:3:9
|
3 | let () = x;
| ^^ expected floating-point variable, found ()
|
= note: expected type `{float}`
= note: found type `()`
, let () = x, , .
, , , float (, ) , i32 f64 float, {integer} {float}.