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