Skip to content

Commit 8b56fa0

Browse files
committed
Add test
1 parent cf95d97 commit 8b56fa0

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![expect(incomplete_features)]
2+
#![feature(adt_const_params, min_generic_const_args)]
3+
4+
struct ArrWrap<const N: [u8; 1]>;
5+
6+
fn main() {
7+
let _: ArrWrap<{ [1_u8] }> = ArrWrap::<{ [1_u16] }>;
8+
//~^ ERROR: mismatched types
9+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/wrapped_array_elem_type_mismatch.rs:7:34
3+
|
4+
LL | let _: ArrWrap<{ [1_u8] }> = ArrWrap::<{ [1_u16] }>;
5+
| ------------------- ^^^^^^^^^^^^^^^^^^^^^^ expected `*b"\x01"`, found `[1]`
6+
| |
7+
| expected due to this
8+
|
9+
= note: expected struct `ArrWrap<*b"\x01">`
10+
found struct `ArrWrap<[1]>`
11+
12+
error: aborting due to 1 previous error
13+
14+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)