diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/unnecessary_wraps.rs | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/unnecessary_wraps.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/unnecessary_wraps.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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<i32> { + //~^ 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<i32> { // should be linted fn func2(a: bool, b: bool) -> Option<i32> { + //~^ 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<i32> { // should be linted fn func5() -> Option<i32> { + //~^ ERROR: this function's return value is unnecessarily wrapped by `Option` Some(1) } @@ -47,6 +52,7 @@ fn func6() -> Option<i32> { // should be linted fn func7() -> Result<i32, ()> { + //~^ 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<i32> { + //~^ 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(()); } |