diff options
| author | Boxy <supbscripter@gmail.com> | 2024-07-14 13:38:51 +0100 |
|---|---|---|
| committer | Boxy <rust@boxyuwu.dev> | 2024-07-17 11:01:29 +0100 |
| commit | d0c11bf6e3fea61711af107c896a763a71606340 (patch) | |
| tree | b4f60d4dc48e8e63b5404961397198b282010102 /tests/ui/const-generics/slice-const-param-mismatch.rs | |
| parent | 42cc42b942088a94d95bc5169724d77429f20582 (diff) | |
| download | rust-d0c11bf6e3fea61711af107c896a763a71606340.tar.gz rust-d0c11bf6e3fea61711af107c896a763a71606340.zip | |
Split part of `adt_const_params` into `unsized_const_params`
Diffstat (limited to 'tests/ui/const-generics/slice-const-param-mismatch.rs')
| -rw-r--r-- | tests/ui/const-generics/slice-const-param-mismatch.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/ui/const-generics/slice-const-param-mismatch.rs b/tests/ui/const-generics/slice-const-param-mismatch.rs index 733eeb69fa9..feee39e602d 100644 --- a/tests/ui/const-generics/slice-const-param-mismatch.rs +++ b/tests/ui/const-generics/slice-const-param-mismatch.rs @@ -1,19 +1,22 @@ -//@ revisions: full min +//@ revisions: min adt_const_params full -#![cfg_attr(full, feature(adt_const_params))] +#![cfg_attr(full, feature(adt_const_params, unsized_const_params))] #![cfg_attr(full, allow(incomplete_features))] - +#![cfg_attr(adt_const_params, feature(adt_const_params))] +#![cfg_attr(adt_const_params, allow(incomplete_features))] struct ConstString<const T: &'static str>; //[min]~^ ERROR +//[adt_const_params]~^^ ERROR struct ConstBytes<const T: &'static [u8]>; //[min]~^ ERROR +//[adt_const_params]~^^ ERROR pub fn main() { let _: ConstString<"Hello"> = ConstString::<"Hello">; let _: ConstString<"Hello"> = ConstString::<"World">; //~ ERROR mismatched types let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↦">; let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; //~ ERROR mismatched types - let _: ConstBytes<b"AAA"> = ConstBytes::<{&[0x41, 0x41, 0x41]}>; + let _: ConstBytes<b"AAA"> = ConstBytes::<{ &[0x41, 0x41, 0x41] }>; let _: ConstBytes<b"AAA"> = ConstBytes::<b"BBB">; //~ ERROR mismatched types } |
