rust/tests/ui/const-generics/issue-102124.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
303 B
Rust
Raw Normal View History

//@ run-pass
//@ compile-flags: -Zmir-opt-level=3
2022-10-07 09:36:59 -05:00
// 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);
}