Skip to content

Commit c4be0cf

Browse files
committed
Added comment to tests/ui/match/match-option-result-mismatch.rs
1 parent c2620f5 commit c4be0cf

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

tests/ui/match/match-option-result-mismatch.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
//! regression test for <https://github.com/rust-lang/rust/issues/3680>
2+
13
fn main() {
2-
match None { //~ NOTE this expression has type `Option<_>`
3-
Err(_) => ()
4+
match None {
5+
//~^ NOTE this expression has type `Option<_>`
6+
Err(_) => (),
47
//~^ ERROR mismatched types
58
//~| NOTE expected enum `Option<_>`
69
//~| NOTE found enum `Result<_, _>`

tests/ui/match/match-option-result-mismatch.stderr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-3680.rs:3:9
2+
--> $DIR/match-option-result-mismatch.rs:6:9
33
|
44
LL | match None {
55
| ---- this expression has type `Option<_>`
6-
LL | Err(_) => ()
6+
LL |
7+
LL | Err(_) => (),
78
| ^^^^^^ expected `Option<_>`, found `Result<_, _>`
89
|
910
= note: expected enum `Option<_>`
1011
found enum `Result<_, _>`
1112
help: try wrapping the pattern in `Some`
1213
|
13-
LL | Some(Err(_)) => ()
14+
LL | Some(Err(_)) => (),
1415
| +++++ +
1516

1617
error: aborting due to 1 previous error

0 commit comments

Comments
 (0)