E0080type-check

Constant evaluation error

A `const` expression overflowed, divided by zero, or otherwise broke at compile time.

Repro

const N: u8 = 200 + 100;   // E0080: arithmetic overflow

Why

const and static expressions evaluate at compile time. Overflow, divide-by-zero, and panic-equivalents in const context become hard compiler errors — better than silently wrapping at runtime.

Fix

- Pick a wider type: const N: u16 = 300;. - Use checked arithmetic in const fn: match a.checked_add(b) { Some(n) => n, None => panic!("overflow") }. - For values that need runtime evaluation, switch to static with a Lazy/OnceCell. - Const-eval errors point at the exact arithmetic — read the span, fix the operand types.

Patterns that solve this