mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
303 B
Rust
21 lines
303 B
Rust
|
//@ 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);
|
||
|
}
|