summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/issue-102124.rs
blob: a28f198e9e0998d8d8a93ad591dfac3c4e08372d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-pass
// compile-flags: -Zmir-opt-level=3

// regression test for #102124

const L: usize = 4;

pub trait Print<const N: usize> {
    fn print(&self) -> usize {
        N
    }
}

pub struct Printer;
impl Print<L> for Printer {}

fn main() {
    let p = Printer;
    assert_eq!(p.print(), 4);
}