diff --git a/src/test/ui/const-generics/issue-102124.rs b/src/test/ui/const-generics/issue-102124.rs new file mode 100644 index 00000000000..a28f198e9e0 --- /dev/null +++ b/src/test/ui/const-generics/issue-102124.rs @@ -0,0 +1,20 @@ +// run-pass +// compile-flags: -Zmir-opt-level=3 + +// regression test for #102124 + +const L: usize = 4; + +pub trait Print { + fn print(&self) -> usize { + N + } +} + +pub struct Printer; +impl Print for Printer {} + +fn main() { + let p = Printer; + assert_eq!(p.print(), 4); +}