about summary refs log tree commit diff
path: root/src/test/ui/const-generics/issues/issue-70225.rs
blob: 8f8d753d0a75fa5b25c6a96b28684245859e5f95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// check-pass
#![feature(const_generics)]
#![allow(incomplete_features)]
#![deny(dead_code)]

// We previously incorrectly linted `L` as unused here.
const L: usize = 3;

fn main() {
    let p = Printer {};
    p.print();
}

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

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