mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-04 05:57:36 +00:00
19 lines
384 B
Rust
19 lines
384 B
Rust
![]() |
//! Regression test for revealing associated types through specialization during const eval.
|
||
|
//@ check-pass
|
||
|
#![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() {}
|