Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 822c7df

Browse files
committed
Add ui_test error annotations in existing tests
1 parent b9906ac commit 822c7df

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

tests/ui/ignored_unit_patterns.fixed

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ fn foo() -> Result<(), ()> {
77

88
fn main() {
99
match foo() {
10-
Ok(()) => {},
11-
Err(()) => {},
10+
Ok(()) => {}, //~ ERROR: matching over `()` is more explicit
11+
Err(()) => {}, //~ ERROR: matching over `()` is more explicit
1212
}
1313
if let Ok(()) = foo() {}
14+
//~^ ERROR: matching over `()` is more explicit
1415
let _ = foo().map_err(|()| todo!());
16+
//~^ ERROR: matching over `()` is more explicit
1517
}

tests/ui/ignored_unit_patterns.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ fn foo() -> Result<(), ()> {
77

88
fn main() {
99
match foo() {
10-
Ok(_) => {},
11-
Err(_) => {},
10+
Ok(_) => {}, //~ ERROR: matching over `()` is more explicit
11+
Err(_) => {}, //~ ERROR: matching over `()` is more explicit
1212
}
1313
if let Ok(_) = foo() {}
14+
//~^ ERROR: matching over `()` is more explicit
1415
let _ = foo().map_err(|_| todo!());
16+
//~^ ERROR: matching over `()` is more explicit
1517
}

tests/ui/ignored_unit_patterns.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LL | if let Ok(_) = foo() {}
1919
| ^ help: use `()` instead of `_`: `()`
2020

2121
error: matching over `()` is more explicit
22-
--> $DIR/ignored_unit_patterns.rs:14:28
22+
--> $DIR/ignored_unit_patterns.rs:15:28
2323
|
2424
LL | let _ = foo().map_err(|_| todo!());
2525
| ^ help: use `()` instead of `_`: `()`

0 commit comments

Comments
 (0)