Skip to content

Commit a80bb5b

Browse files
committed
add a test for rust-lang#70408
1 parent fac8fa5 commit a80bb5b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)