about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-10-08 18:15:00 -0700
committerGitHub <noreply@github.com>2022-10-08 18:15:00 -0700
commitf1ab04ffbbb63a2a3ce9a9de07e0177988383ede (patch)
tree05338efc6ad3bc8283d56ce7f2e966713ede0d5a /src
parent825014e88992c3516c846659ce7cfdd5a781e216 (diff)
parent462730fdaef6ea1a6e05e2f8c889a7c5106df796 (diff)
downloadrust-f1ab04ffbbb63a2a3ce9a9de07e0177988383ede.tar.gz
rust-f1ab04ffbbb63a2a3ce9a9de07e0177988383ede.zip
Rollup merge of #102782 - Hosshii:issue-102124, r=Mark-Simulacrum
Add regression test for #102124

closes #102124, which was already fixed on nightly.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/const-generics/issue-102124.rs20
1 files changed, 20 insertions, 0 deletions
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<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);
+}