about summary refs log tree commit diff
path: root/tests/ui/const-generics/adt_const_params/alias_const_param_ty-2.rs
blob: 961e1a9cfbf43dc2a2c5c6a03211e8b0b8ff1e89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ check-pass
#![feature(adt_const_params)]

const EMPTY_MATRIX: <Type as Trait>::Matrix = [0; 1];

pub struct Walk<const REMAINING: <Type as Trait>::Matrix> {}

impl Walk<EMPTY_MATRIX> {
    pub const fn new() -> Self {
        Self {}
    }
}

pub enum Type {}
pub trait Trait {
    type Matrix;
}
impl Trait for Type {
    type Matrix = [usize; 1];
}

fn main() {
    let _ = Walk::new();
}