mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
20 lines
255 B
Rust
20 lines
255 B
Rust
trait Dim {
|
|
fn dim() -> usize;
|
|
}
|
|
|
|
enum Dim3 {}
|
|
|
|
impl Dim for Dim3 {
|
|
fn dim() -> usize {
|
|
3
|
|
}
|
|
}
|
|
|
|
pub struct Vector<T, D: Dim> {
|
|
entries: [T; D::dim()],
|
|
//~^ ERROR generic parameters may not be used
|
|
_dummy: D,
|
|
}
|
|
|
|
fn main() {}
|