Skip to content

Commit 05d0b96

Browse files
committed
Add test for error message
1 parent 4d52dc4 commit 05d0b96

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
let a = &[];
3+
let b: &Vec<u8> = &vec![];
4+
a > b;
5+
//~^ ERROR mismatched types
6+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/slice-to-vec-comparison.rs:4:9
3+
|
4+
LL | a > b;
5+
| ^ expected array of 0 elements , found struct `Vec`
6+
|
7+
= note: expected reference `&[_; 0]`
8+
found reference `&Vec<u8>`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)