2021-09-02 15:20:51 -05:00
|
|
|
//@ run-pass
|
2024-07-14 07:38:51 -05:00
|
|
|
#![feature(adt_const_params, unsized_const_params, generic_const_exprs)]
|
2021-09-02 15:30:13 -05:00
|
|
|
#![allow(incomplete_features)]
|
2021-09-02 15:20:51 -05:00
|
|
|
|
|
|
|
pub trait Foo {
|
|
|
|
const ASSOC_C: usize;
|
2024-07-14 07:38:51 -05:00
|
|
|
fn foo()
|
|
|
|
where
|
|
|
|
[(); Self::ASSOC_C]:;
|
2021-09-02 15:20:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar<const N: &'static ()>;
|
|
|
|
impl<const N: &'static ()> Foo for Bar<N> {
|
|
|
|
const ASSOC_C: usize = 3;
|
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
fn foo()
|
|
|
|
where
|
|
|
|
[u8; Self::ASSOC_C]:,
|
|
|
|
{
|
2021-09-02 15:20:51 -05:00
|
|
|
let _: [u8; Self::ASSOC_C] = loop {};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|