From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/clippy/tests/ui/unnecessary_wraps.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/tools/clippy/tests/ui/unnecessary_wraps.rs') diff --git a/src/tools/clippy/tests/ui/unnecessary_wraps.rs b/src/tools/clippy/tests/ui/unnecessary_wraps.rs index 63648ef58..200aefff1 100644 --- a/src/tools/clippy/tests/ui/unnecessary_wraps.rs +++ b/src/tools/clippy/tests/ui/unnecessary_wraps.rs @@ -1,3 +1,4 @@ +//@no-rustfix: overlapping suggestions #![warn(clippy::unnecessary_wraps)] #![allow(clippy::no_effect)] #![allow(clippy::needless_return)] @@ -6,6 +7,8 @@ // should be linted fn func1(a: bool, b: bool) -> Option { + //~^ ERROR: this function's return value is unnecessarily wrapped by `Option` + //~| NOTE: `-D clippy::unnecessary-wraps` implied by `-D warnings` if a && b { return Some(42); } @@ -19,6 +22,7 @@ fn func1(a: bool, b: bool) -> Option { // should be linted fn func2(a: bool, b: bool) -> Option { + //~^ ERROR: this function's return value is unnecessarily wrapped by `Option` if a && b { return Some(10); } @@ -37,6 +41,7 @@ fn func4(a: bool) -> Option { // should be linted fn func5() -> Option { + //~^ ERROR: this function's return value is unnecessarily wrapped by `Option` Some(1) } @@ -47,6 +52,7 @@ fn func6() -> Option { // should be linted fn func7() -> Result { + //~^ ERROR: this function's return value is unnecessarily wrapped by `Result` Ok(1) } @@ -75,6 +81,7 @@ impl A { // should be linted fn func12() -> Option { + //~^ ERROR: this function's return value is unnecessarily wrapped by `Option` Some(1) } } @@ -102,6 +109,7 @@ fn issue_6384(s: &str) -> Option<&str> { // should be linted fn issue_6640_1(a: bool, b: bool) -> Option<()> { + //~^ ERROR: this function's return value is unnecessary if a && b { return Some(()); } @@ -115,6 +123,7 @@ fn issue_6640_1(a: bool, b: bool) -> Option<()> { // should be linted fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> { + //~^ ERROR: this function's return value is unnecessary if a && b { return Ok(()); } -- cgit v1.2.3