Skip to content

Commit

Permalink
Add regression test for rust-lang#102124
Browse files Browse the repository at this point in the history
  • Loading branch information
Hosshii committed Oct 7, 2022
1 parent e42c4d7 commit 462730f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/const-generics/issue-102124.rs
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 462730f

Please sign in to comment.