Skip to content

Commit 29a00ef

Browse files
committed
Add test for issue-50900
1 parent 9a239ef commit 29a00ef

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

Diff for: src/test/ui/issues/issue-50900.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#[derive(PartialEq, Eq)]
2+
pub struct Tag(pub Context, pub u16);
3+
4+
#[derive(PartialEq, Eq)]
5+
pub enum Context {
6+
Tiff,
7+
Exif,
8+
}
9+
10+
impl Tag {
11+
const ExifIFDPointer: Tag = Tag(Context::Tiff, 34665);
12+
}
13+
14+
fn main() {
15+
match Tag::ExifIFDPointer {
16+
//~^ ERROR: non-exhaustive patterns: `Tag(Exif, _)` not covered
17+
Tag::ExifIFDPointer => {}
18+
}
19+
}

Diff for: src/test/ui/issues/issue-50900.stderr

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0004]: non-exhaustive patterns: `Tag(Exif, _)` not covered
2+
--> $DIR/issue-50900.rs:15:11
3+
|
4+
LL | pub struct Tag(pub Context, pub u16);
5+
| ------------------------------------- `Tag` defined here
6+
...
7+
LL | match Tag::ExifIFDPointer {
8+
| ^^^^^^^^^^^^^^^^^^^ pattern `Tag(Exif, _)` not covered
9+
|
10+
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0004`.

0 commit comments

Comments
 (0)