Sisu
E0075

Base prefix in upper case

ErrorSafe fix

Built from the repository at commit a8614dc.

A number in another base starts with a lower case prefix: 0x for hexadecimal, 0b for binary and 0o for octal. 0X1F, 0B1 and 0O7 are errors.

Why

One spelling per prefix keeps code uniform, and an upper case O next to a 0 is easy to misread. The fix lower-cases the prefix and nothing else, so it is safe. The one exception is a value of magnitude 2^63, such as 0X8000_0000_0000_0000: it is valid only after a -, so there the fix is unsafe.

Broken

fn main() {
    let n = 0X1F
    print(n)
}

What sisu says

error[E0075]: base prefixes are lower case
 --> E0075.sisu:2:13
  |
2 |     let n = 0X1F
  |             ^^
  |
help: write the prefix in lower case
  |
2 -     let n = 0X1F
2 +     let n = 0x1F
  |

sisu: 1 error
sisu: for more on a code, run `sisu explain <code>`: E0075

Fixed

fn main() {
    let n = 0x1F
    print(n)
}