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:
Michael Howell 2022-10-08 18:15:00 -07:00 committed by GitHub
commit f1ab04ffbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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