blob: 68dfa391bb485c03f3e4934e2e3da536193d4f30 [file] [log] [blame]
//@ build-fail
//@ revisions: direct indirect
#![feature(default_field_values)]
struct Z<const X: usize> {
post_mono: usize = X / 0,
//~^ ERROR attempt to divide `1_usize` by zero
}
fn indirect<const X: usize>() {
let x: Z<X> = Z { .. };
}
#[cfg(direct)]
fn main() {
let x: Z<1> = Z { .. };
}
#[cfg(indirect)]
fn main() {
indirect::<1>();
}