3 #![feature(const_generics)]
4 //~^ WARN the feature `const_generics` is incomplete
6 pub fn function_with_str<const STRING: &'static str>() -> &'static str {
10 pub fn function_with_bytes<const BYTES: &'static [u8]>() -> &'static [u8] {
15 assert_eq!(function_with_str::<"Rust">(), "Rust");
16 assert_eq!(function_with_str::<"ℇ㇈↦">(), "ℇ㇈↦");
17 assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]);
18 assert_eq!(function_with_bytes::<{&[0x41, 0x41, 0x41, 0x41]}>(), b"AAAA");