E1068: integer literal outside the range of its type
An integer literal must fit the type it takes.
An integer literal must fit the type it takes. A suffixed literal such as
300u8 has its type from the suffix. An unsuffixed literal takes the type of
the binding or of the other operand, so x + 300 with x: u8 is rejected at
the literal (ADR-0119). The message names the literal and the type. The error
points at the literal, or at the statement when the type comes from the
binding. Int is a 32-bit signed integer and Usize a 64-bit unsigned one, so
3000000000 is out of range for an Int wherever an Int is taken: an
initializer, an assignment, an argument, a return value, a field, an operand,
an element, a constant or a buffer index.
Example
Fix
Use a value that fits, or a wider type. A cast of a literal is checked with
its own code, E1091.
Run actus explain E1068 in your terminal to read this entry offline. Browse Ownership & types or all error codes.