mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
33 lines
571 B
Rust
33 lines
571 B
Rust
//@ check-pass
|
|
#![feature(generic_const_exprs)]
|
|
#![allow(incomplete_features)]
|
|
|
|
struct Num<const N: usize>;
|
|
|
|
trait NumT {
|
|
const VALUE: usize;
|
|
}
|
|
|
|
impl<const N: usize> NumT for Num<N> {
|
|
const VALUE: usize = N;
|
|
}
|
|
|
|
struct Foo<'a, N: NumT>(&'a [u32; N::VALUE]) where [(); N::VALUE]:;
|
|
|
|
trait Bar {
|
|
type Size: NumT;
|
|
|
|
fn bar<'a>(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
|
|
todo!();
|
|
}
|
|
}
|
|
|
|
trait Baz<'a> {
|
|
type Size: NumT;
|
|
|
|
fn baz(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
|
|
todo!();
|
|
}
|
|
}
|
|
|
|
fn main() {}
|