summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/unnecessary_wraps.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/unnecessary_wraps.rs')
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_wraps.rs9
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(());
}