Rollup merge of #99004 - TaKO8Ki:add-test-for-70408, r=Mark-Simulacrum

Add a test for #70408

closes #70408
This commit is contained in:
Matthias Krüger 2022-07-07 20:33:31 +02:00 committed by GitHub
commit 16ad2f50b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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");
}