Skip to content

Commit

Permalink
add a test for #70408
Browse files Browse the repository at this point in the history
  • Loading branch information
TaKO8Ki committed Jul 7, 2022
1 parent fac8fa5 commit a80bb5b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/ui/const-generics/issue-70408.rs
Original file line number Diff line number Diff line change
@@ -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");
}

0 comments on commit a80bb5b

Please sign in to comment.