add a test for #70408
This commit is contained in:
parent
fac8fa5672
commit
a80bb5b387
1 changed files with 13 additions and 0 deletions
13
src/test/ui/const-generics/issue-70408.rs
Normal file
13
src/test/ui/const-generics/issue-70408.rs
Normal 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");
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue