From 76a536c5901dbe8b5a805f96cd6f4f89cfec3ce3 Mon Sep 17 00:00:00 2001 From: Ada Alakbarova Date: Thu, 22 Jan 2026 00:17:38 +0100 Subject: [PATCH] test: remove `unwrap.rs` The file is testing `unwrap_used`, but that's already covered by the `unwrap_expect_used.rs` test file --- tests/ui/unwrap.rs | 22 ---------------------- tests/ui/unwrap.stderr | 31 ------------------------------- 2 files changed, 53 deletions(-) delete mode 100644 tests/ui/unwrap.rs delete mode 100644 tests/ui/unwrap.stderr diff --git a/tests/ui/unwrap.rs b/tests/ui/unwrap.rs deleted file mode 100644 index 3191b396f99b..000000000000 --- a/tests/ui/unwrap.rs +++ /dev/null @@ -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 = Ok(0); - let _ = res.unwrap(); - //~^ unwrap_used - - let _ = res.unwrap_err(); - //~^ unwrap_used -} - -fn main() { - unwrap_option(); - unwrap_result(); -} diff --git a/tests/ui/unwrap.stderr b/tests/ui/unwrap.stderr deleted file mode 100644 index c242541a6bd7..000000000000 --- a/tests/ui/unwrap.stderr +++ /dev/null @@ -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 -