about summary refs log tree commit diff
path: root/tests/ui/const-generics/const-ty-is-normalized.rs
blob: 784145f735ed32a291a51a6632b44bce9bcb1d31 (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
25
//@ compile-flags: -Cdebuginfo=2 --crate-type=lib
//@ build-pass
#![feature(adt_const_params)]

const N_ISLANDS: usize = 4;

pub type Matrix = [[usize; N_ISLANDS]; N_ISLANDS];

const EMPTY_MATRIX: Matrix = [[0; N_ISLANDS]; N_ISLANDS];

const fn to_matrix() -> Matrix {
    EMPTY_MATRIX
}

const BRIDGE_MATRIX: [[usize; N_ISLANDS]; N_ISLANDS] = to_matrix();

pub struct Walk<const CURRENT: usize, const REMAINING: Matrix> {
    _p: (),
}

impl Walk<0, BRIDGE_MATRIX> {
    pub const fn new() -> Self {
        Self { _p: () }
    }
}