E0110
Format spec width or precision above its limit
ErrorA width in a format spec is at most 1000, and a precision at most 30: {x:1000.30} is the largest spec. The error points at the spec, from its :, and names the limit it breaks.
Why
The limits bound the room one formatted part takes in the result, so a program cannot ask for a megabyte of padding by mistake. A width above 1000 or a precision above 30 is almost always a typo. There is no fix, since the value you meant is not known.
Broken
fn main() {
let x = 2.5
print("{x:.31}")
}
What sisu says
error[E0110]: a precision is at most 30 --> E0110.sisu:3:14 | 3 | print("{x:.31}") | ^^^^ sisu: 1 error sisu: for more on a code, run `sisu explain <code>`: E0110
Fixed
fn main() {
let x = 2.5
print("{x:.3}")
}
Related
- E0108: a format spec that the grammar does not hold.
Sisu