mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-29 11:37:39 +00:00
17 lines
233 B
Rust
17 lines
233 B
Rust
![]() |
// check-pass
|
||
|
struct Foo<const N: usize>;
|
||
|
|
||
|
impl<const N: usize> Foo<N> {
|
||
|
const VALUE: usize = N * 2;
|
||
|
}
|
||
|
|
||
|
trait Bar {
|
||
|
const ASSOC: usize;
|
||
|
}
|
||
|
|
||
|
impl<const N: usize> Bar for Foo<N> {
|
||
|
const ASSOC: usize = N * 3;
|
||
|
}
|
||
|
|
||
|
fn main() {}
|