summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs')
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs
new file mode 100644
index 000000000..67e30232e
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs
@@ -0,0 +1,25 @@
+// check-pass
+
+#![feature(adt_const_params, generic_const_exprs)]
+//~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
+//~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
+
+pub struct Changes<const CHANGES: &'static [&'static str]>
+where
+ [(); CHANGES.len()]:,
+{
+ changes: [usize; CHANGES.len()],
+}
+
+impl<const CHANGES: &'static [&'static str]> Changes<CHANGES>
+where
+ [(); CHANGES.len()]:,
+{
+ pub const fn new() -> Self {
+ Self {
+ changes: [0; CHANGES.len()],
+ }
+ }
+}
+
+pub fn main() {}