Files
rust/tests/ui/associated-consts/assoc-const-in-array-initializer.rs
T
2026-05-01 14:30:58 +01:00

23 lines
340 B
Rust

//! Regression test for https://github.com/rust-lang/rust/issues/31267
//@ run-pass
#[derive(Clone, Copy, Debug)]
struct Bar;
const BAZ: Bar = Bar;
#[derive(Debug)]
struct Foo(#[allow(dead_code)] [Bar; 1]);
struct Biz;
impl Biz {
const BAZ: Foo = Foo([BAZ; 1]);
}
fn main() {
let foo = Biz::BAZ;
println!("{:?}", foo);
}