2024-01-10 10:54:43 -06:00
|
|
|
//! Regression test for revealing associated types through specialization during const eval.
|
2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
2024-01-10 10:54:43 -06:00
|
|
|
#![feature(specialization)]
|
|
|
|
//~^ WARNING the feature `specialization` is incomplete and may not be safe to use
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
const ASSOC: usize;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo for u32 {
|
|
|
|
default const ASSOC: usize = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo() -> [u8; 0] {
|
|
|
|
[0; <u32 as Foo>::ASSOC]
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|