Skip to content

Commit

Permalink
Rollup merge of #102782 - Hosshii:issue-102124, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Add regression test for #102124

closes #102124, which was already fixed on nightly.
  • Loading branch information
notriddle committed Oct 9, 2022
2 parents 825014e + 462730f commit f1ab04f
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 f1ab04f

Please sign in to comment.