summary refs log tree commit diff
path: root/src/test/ui/const_prop/ice-assert-fail-div-by-zero.rs
blob: d19cf00eb9ce4e71ac35985fd6c14a9d99fdd47f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// check-pass

// compile-flags: --crate-type lib

#![warn(unconditional_panic)]

pub struct Fixed64(i64);

// HACK: this test passes only because this is a const fn that is written to metadata
pub const fn div(f: Fixed64) {
    f.0 / 0; //~ WARN will panic at runtime
}