4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
7 pub fn function_with_str<const STRING: &'static str>() -> &'static str {
8 //[min]~^ ERROR `&'static str` is forbidden
12 pub fn function_with_bytes<const BYTES: &'static [u8]>() -> &'static [u8] {
13 //[min]~^ ERROR `&'static [u8]` is forbidden
18 assert_eq!(function_with_str::<"Rust">(), "Rust");
19 assert_eq!(function_with_str::<"ℇ㇈↦">(), "ℇ㇈↦");
20 assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]);
21 assert_eq!(function_with_bytes::<{&[0x41, 0x41, 0x41, 0x41]}>(), b"AAAA");