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:
commit
f1ab04ffbb
20
src/test/ui/const-generics/issue-102124.rs
Normal file
20
src/test/ui/const-generics/issue-102124.rs
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user