summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/impl-const-generic-struct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/impl-const-generic-struct.rs')
-rw-r--r--src/test/ui/const-generics/impl-const-generic-struct.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/impl-const-generic-struct.rs b/src/test/ui/const-generics/impl-const-generic-struct.rs
new file mode 100644
index 000000000..7eb2c6a51
--- /dev/null
+++ b/src/test/ui/const-generics/impl-const-generic-struct.rs
@@ -0,0 +1,12 @@
+// run-pass
+struct S<const X: u32>;
+
+impl<const X: u32> S<X> {
+ fn x() -> u32 {
+ X
+ }
+}
+
+fn main() {
+ assert_eq!(S::<19>::x(), 19);
+}