@@ -47,6 +47,44 @@ LL | if let b"test" = *b"this array is too long" {}
4747 | |
4848 | expected an array with a size of 22, found one with a size of 4
4949
50- error: aborting due to 5 previous errors
50+ error[E0308]: mismatched types
51+ --> $DIR/byte-string-type-errors.rs:39:12
52+ |
53+ LL | if let b"test" = &mut () {}
54+ | ^^^^^^^ ------- this expression has type `&mut ()`
55+ | |
56+ | expected `()`, found `&[u8; 4]`
57+
58+ error[E0308]: mismatched types
59+ --> $DIR/byte-string-type-errors.rs:44:12
60+ |
61+ LL | if let b"test" = &mut [] as &mut [i8] {}
62+ | ^^^^^^^ -------------------- this expression has type `&mut [i8]`
63+ | |
64+ | expected `[i8]`, found `[u8]`
65+ |
66+ = note: expected slice `[i8]`
67+ found slice `[u8]`
68+
69+ error[E0308]: mismatched types
70+ --> $DIR/byte-string-type-errors.rs:48:12
71+ |
72+ LL | if let b"test" = &mut [()] {}
73+ | ^^^^^^^ --------- this expression has type `&mut [(); 1]`
74+ | |
75+ | expected `[(); 1]`, found `[u8; 4]`
76+ |
77+ = note: expected array `[(); 1]`
78+ found array `[u8; 4]`
79+
80+ error[E0308]: mismatched types
81+ --> $DIR/byte-string-type-errors.rs:52:12
82+ |
83+ LL | if let b"test" = &mut *b"this array is too long" {}
84+ | ^^^^^^^ ------------------------------- this expression has type `&mut [u8; 22]`
85+ | |
86+ | expected an array with a size of 22, found one with a size of 4
87+
88+ error: aborting due to 9 previous errors
5189
5290For more information about this error, try `rustc --explain E0308`.
0 commit comments