test: remove unwrap.rs (#16437)

The file is testing `unwrap_used`, but that's already covered by the
`unwrap_expect_used.rs` test file

changelog: none
This commit is contained in:
dswij 2026-01-23 04:43:59 +00:00 committed by GitHub
commit 62846d25e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 53 deletions

View file

@ -1,22 +0,0 @@
#![warn(clippy::unwrap_used)]
#![allow(clippy::unnecessary_literal_unwrap)]
fn unwrap_option() {
let opt = Some(0);
let _ = opt.unwrap();
//~^ unwrap_used
}
fn unwrap_result() {
let res: Result<u8, u8> = Ok(0);
let _ = res.unwrap();
//~^ unwrap_used
let _ = res.unwrap_err();
//~^ unwrap_used
}
fn main() {
unwrap_option();
unwrap_result();
}

View file

@ -1,31 +0,0 @@
error: used `unwrap()` on an `Option` value
--> tests/ui/unwrap.rs:6:13
|
LL | let _ = opt.unwrap();
| ^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= note: `-D clippy::unwrap-used` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unwrap_used)]`
error: used `unwrap()` on a `Result` value
--> tests/ui/unwrap.rs:12:13
|
LL | let _ = res.unwrap();
| ^^^^^^^^^^^^
|
= note: if this value is an `Err`, it will panic
= help: consider using `expect()` to provide a better panic message
error: used `unwrap_err()` on a `Result` value
--> tests/ui/unwrap.rs:15:13
|
LL | let _ = res.unwrap_err();
| ^^^^^^^^^^^^^^^^
|
= note: if this value is an `Ok`, it will panic
= help: consider using `expect_err()` to provide a better panic message
error: aborting due to 3 previous errors