rust/tests/ui/const-generics/issues/issue-70125-1.rs
2024-02-16 20:02:50 +00:00

18 lines
234 B
Rust

//@ run-pass
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);
}