mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
15 lines
239 B
Rust
15 lines
239 B
Rust
//@ revisions:rpass1
|
|
|
|
struct FakeArray<T, const N: usize>(T);
|
|
|
|
impl<T, const N: usize> FakeArray<T, N> {
|
|
fn len(&self) -> usize {
|
|
N
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let fa = FakeArray::<u32, { 32 }>(1);
|
|
assert_eq!(fa.len(), 32);
|
|
}
|