summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/issue-70408.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/issue-70408.rs')
-rw-r--r--src/test/ui/const-generics/issue-70408.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/issue-70408.rs b/src/test/ui/const-generics/issue-70408.rs
new file mode 100644
index 000000000..f7557cb49
--- /dev/null
+++ b/src/test/ui/const-generics/issue-70408.rs
@@ -0,0 +1,13 @@
+// build-pass
+
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
+
+pub fn function_with_bytes<const BYTES: &'static [u8; 4]>() -> &'static [u8] {
+ BYTES
+}
+
+pub fn main() {
+ assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]);
+ assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA");
+}