1 #![feature(const_generics)]
2 //~^ WARN the feature `const_generics` is incomplete
4 struct ConstString<const T: &'static str>;
5 struct ConstBytes<const T: &'static [u8]>;
8 let _: ConstString<"Hello"> = ConstString::<"Hello">;
9 let _: ConstString<"Hello"> = ConstString::<"World">; //~ ERROR mismatched types
10 let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↦">;
11 let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; //~ ERROR mismatched types
12 let _: ConstBytes<b"AAA"> = ConstBytes::<{&[0x41, 0x41, 0x41]}>;
13 let _: ConstBytes<b"AAA"> = ConstBytes::<b"BBB">; //~ ERROR mismatched types