mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
24 lines
385 B
Rust
24 lines
385 B
Rust
//@ build-fail
|
|
//@ revisions: direct indirect
|
|
|
|
#![feature(default_field_values)]
|
|
|
|
struct Z<const X: usize> {
|
|
post_mono: usize = X / 0,
|
|
//~^ ERROR evaluation of `Z::<1>::post_mono::{constant#0}` failed
|
|
}
|
|
|
|
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>();
|
|
}
|