Runtime error (panic) noticed during compilation.



examples/errors/div-by-zero-hard-coded/src/main.rs
fn main() {
    let a = 8;
    let b = 2;
    let c = 0;
    let x = a / b;
    println!("{x}");

    #[allow(unconditional_panic)]
    let y = a / c;
    println!("{y}");
}

error: this operation will panic at runtime
 --> examples/errors/div_by_zero_hard_coded.rs:8:13
  |
8 |     let y = a / c;
  |             ^^^^^ attempt to divide `8_i32` by zero
  |
  = note: `#[deny(unconditional_panic)]` on by default

error: aborting due to previous error