From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/const-generics/slice-const-param-mismatch.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/ui/const-generics/slice-const-param-mismatch.rs (limited to 'src/test/ui/const-generics/slice-const-param-mismatch.rs') diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.rs b/src/test/ui/const-generics/slice-const-param-mismatch.rs new file mode 100644 index 000000000..7127323e5 --- /dev/null +++ b/src/test/ui/const-generics/slice-const-param-mismatch.rs @@ -0,0 +1,19 @@ +// revisions: full min + +#![cfg_attr(full, feature(adt_const_params))] +#![cfg_attr(full, allow(incomplete_features))] + + +struct ConstString; +//[min]~^ ERROR +struct ConstBytes; +//[min]~^ ERROR + +pub fn main() { + let _: ConstString<"Hello"> = ConstString::<"Hello">; + let _: ConstString<"Hello"> = ConstString::<"World">; //[full]~ ERROR mismatched types + let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↦">; + let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; //[full]~ ERROR mismatched types + let _: ConstBytes = ConstBytes::<{&[0x41, 0x41, 0x41]}>; + let _: ConstBytes = ConstBytes::; //[full]~ ERROR mismatched types +} -- cgit v1.2.3