mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
Rollup merge of #102782 - Hosshii:issue-102124, r=Mark-Simulacrum
Add regression test for #102124 closes #102124, which was already fixed on nightly.
This commit is contained in:
@@ -0,0 +1,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);
|
||||
}
|
||||
Reference in New Issue
Block a user