Add ui_test error annotations in existing tests

This commit is contained in:
Samuel Tardieu 2023-09-04 17:04:04 +02:00
parent b9906aca5a
commit 822c7df545
3 changed files with 9 additions and 5 deletions

View File

@ -7,9 +7,11 @@ fn foo() -> Result<(), ()> {
fn main() {
match foo() {
Ok(()) => {},
Err(()) => {},
Ok(()) => {}, //~ ERROR: matching over `()` is more explicit
Err(()) => {}, //~ ERROR: matching over `()` is more explicit
}
if let Ok(()) = foo() {}
//~^ ERROR: matching over `()` is more explicit
let _ = foo().map_err(|()| todo!());
//~^ ERROR: matching over `()` is more explicit
}

View File

@ -7,9 +7,11 @@ fn foo() -> Result<(), ()> {
fn main() {
match foo() {
Ok(_) => {},
Err(_) => {},
Ok(_) => {}, //~ ERROR: matching over `()` is more explicit
Err(_) => {}, //~ ERROR: matching over `()` is more explicit
}
if let Ok(_) = foo() {}
//~^ ERROR: matching over `()` is more explicit
let _ = foo().map_err(|_| todo!());
//~^ ERROR: matching over `()` is more explicit
}

View File

@ -19,7 +19,7 @@ LL | if let Ok(_) = foo() {}
| ^ help: use `()` instead of `_`: `()`
error: matching over `()` is more explicit
--> $DIR/ignored_unit_patterns.rs:14:28
--> $DIR/ignored_unit_patterns.rs:15:28
|
LL | let _ = foo().map_err(|_| todo!());
| ^ help: use `()` instead of `_`: `()`