]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issue-70408.rs
Rollup merge of #99479 - Enselic:import-can-be-without-id, r=camelid
[rust.git] / src / test / ui / const-generics / issue-70408.rs
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 }