Skip to content

Commit 16ad2f5

Browse files
authored
Rollup merge of rust-lang#99004 - TaKO8Ki:add-test-for-70408, r=Mark-Simulacrum
Add a test for rust-lang#70408 closes rust-lang#70408
2 parents 7fed4ff + a80bb5b commit 16ad2f5

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)