mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
24 lines
423 B
Rust
24 lines
423 B
Rust
//@ build-fail
|
|
//@ revisions: direct indirect
|
|
//@ ignore-parallel-frontend post-monomorphization errors
|
|
#![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>();
|
|
}
|