P0001

Integer overflow: the result of +, -, *, /, or unary - does not fit its type, as with a U8 0 - 1 or an I8 -128 / -1. Spans the operation.

Machine-applicable fix: none.

Example

This program fails with P0001.

fn main() {
    let x: U8 = 255
    let y = x + 1
}

Fixed

The same program, fixed.

fn main() {
    let x: Int = 255
    let y = x + 1
}

Listed in the runtime notes. oskac explain P0001 prints this entry offline.

All error codes