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