We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7fed4ff + a80bb5b commit 16ad2f5Copy full SHA for 16ad2f5
1 file changed
src/test/ui/const-generics/issue-70408.rs
@@ -0,0 +1,13 @@
1
+// build-pass
2
+
3
+#![feature(adt_const_params)]
4
+#![allow(incomplete_features)]
5
6
+pub fn function_with_bytes<const BYTES: &'static [u8; 4]>() -> &'static [u8] {
7
+ BYTES
8
+}
9
10
+pub fn main() {
11
+ assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]);
12
+ assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA");
13
0 commit comments