2021-08-27 11:04:57 -05:00
|
|
|
// run-pass
|
2019-09-27 02:43:46 -05:00
|
|
|
|
2021-08-30 03:59:53 -05:00
|
|
|
#![feature(adt_const_params)]
|
2021-08-27 11:04:57 -05:00
|
|
|
#![allow(incomplete_features)]
|
2019-09-27 02:43:46 -05:00
|
|
|
|
|
|
|
pub fn function_with_str<const STRING: &'static str>() -> &'static str {
|
|
|
|
STRING
|
|
|
|
}
|
|
|
|
|
2019-09-27 22:07:22 -05:00
|
|
|
pub fn function_with_bytes<const BYTES: &'static [u8]>() -> &'static [u8] {
|
|
|
|
BYTES
|
|
|
|
}
|
|
|
|
|
2019-09-27 02:43:46 -05:00
|
|
|
pub fn main() {
|
|
|
|
assert_eq!(function_with_str::<"Rust">(), "Rust");
|
2019-09-28 14:39:48 -05:00
|
|
|
assert_eq!(function_with_str::<"ℇ㇈↦">(), "ℇ㇈↦");
|
2019-09-27 22:07:22 -05:00
|
|
|
assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]);
|
|
|
|
assert_eq!(function_with_bytes::<{&[0x41, 0x41, 0x41, 0x41]}>(), b"AAAA");
|
2019-09-27 02:43:46 -05:00
|
|
|
}
|