2020-08-10 18:50:58 +00:00
|
|
|
// revisions: full min
|
|
|
|
|
2021-08-30 10:59:53 +02:00
|
|
|
#![cfg_attr(full, feature(adt_const_params))]
|
2020-08-10 18:50:58 +00:00
|
|
|
#![cfg_attr(full, allow(incomplete_features))]
|
|
|
|
|
2019-09-28 15:07:22 +12:00
|
|
|
|
|
|
|
struct ConstString<const T: &'static str>;
|
2020-08-10 18:50:58 +00:00
|
|
|
//[min]~^ ERROR
|
2019-09-28 15:07:22 +12:00
|
|
|
struct ConstBytes<const T: &'static [u8]>;
|
2020-08-10 18:50:58 +00:00
|
|
|
//[min]~^ ERROR
|
2019-09-28 15:07:22 +12:00
|
|
|
|
|
|
|
pub fn main() {
|
2019-09-29 08:39:48 +13:00
|
|
|
let _: ConstString<"Hello"> = ConstString::<"Hello">;
|
2020-08-10 18:50:58 +00:00
|
|
|
let _: ConstString<"Hello"> = ConstString::<"World">; //[full]~ ERROR mismatched types
|
2019-09-29 08:39:48 +13:00
|
|
|
let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↦">;
|
2020-08-10 18:50:58 +00:00
|
|
|
let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; //[full]~ ERROR mismatched types
|
2019-09-28 15:07:22 +12:00
|
|
|
let _: ConstBytes<b"AAA"> = ConstBytes::<{&[0x41, 0x41, 0x41]}>;
|
2020-08-10 18:50:58 +00:00
|
|
|
let _: ConstBytes<b"AAA"> = ConstBytes::<b"BBB">; //[full]~ ERROR mismatched types
|
2019-09-28 15:07:22 +12:00
|
|
|
}
|