about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/try_err.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/try_err.fixed')
-rw-r--r--src/tools/clippy/tests/ui/try_err.fixed11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/try_err.fixed b/src/tools/clippy/tests/ui/try_err.fixed
index f149bfb7774..ea509f9a2da 100644
--- a/src/tools/clippy/tests/ui/try_err.fixed
+++ b/src/tools/clippy/tests/ui/try_err.fixed
@@ -20,6 +20,7 @@ pub fn basic_test() -> Result<i32, i32> {
     // To avoid warnings during rustfix
     if true {
         return Err(err);
+        //~^ try_err
     }
     Ok(0)
 }
@@ -30,6 +31,7 @@ pub fn into_test() -> Result<i32, i32> {
     // To avoid warnings during rustfix
     if true {
         return Err(err.into());
+        //~^ try_err
     }
     Ok(0)
 }
@@ -50,6 +52,7 @@ pub fn closure_matches_test() -> Result<i32, i32> {
             // To avoid warnings during rustfix
             if true {
                 return Err(err);
+                //~^ try_err
             }
             Ok(i)
         })
@@ -69,6 +72,7 @@ pub fn closure_into_test() -> Result<i32, i32> {
             // To avoid warnings during rustfix
             if true {
                 return Err(err.into());
+                //~^ try_err
             }
             Ok(i)
         })
@@ -89,6 +93,7 @@ fn calling_macro() -> Result<i32, i32> {
         match $(Ok::<_, i32>(5)) {
             Ok(_) => 0,
             Err(_) => return Err(1),
+            //~^ try_err
         }
     );
     // `Err` arg is another macro
@@ -96,6 +101,7 @@ fn calling_macro() -> Result<i32, i32> {
         match $(Ok::<_, i32>(5)) {
             Ok(_) => 0,
             Err(_) => return Err(inline!(1)),
+            //~^ try_err
         }
     );
     Ok(5)
@@ -123,6 +129,7 @@ fn main() {
 pub fn macro_inside(fail: bool) -> Result<i32, String> {
     if fail {
         return Err(inline!(inline!(String::from("aasdfasdfasdfa"))));
+        //~^ try_err
     }
     Ok(0)
 }
@@ -130,8 +137,10 @@ pub fn macro_inside(fail: bool) -> Result<i32, String> {
 pub fn poll_write(n: usize) -> Poll<io::Result<usize>> {
     if n == 0 {
         return Poll::Ready(Err(io::ErrorKind::WriteZero.into()))
+        //~^ try_err
     } else if n == 1 {
         return Poll::Ready(Err(io::Error::new(io::ErrorKind::InvalidInput, "error")))
+        //~^ try_err
     };
 
     Poll::Ready(Ok(n))
@@ -140,6 +149,7 @@ pub fn poll_write(n: usize) -> Poll<io::Result<usize>> {
 pub fn poll_next(ready: bool) -> Poll<Option<io::Result<()>>> {
     if !ready {
         return Poll::Ready(Some(Err(io::ErrorKind::NotFound.into())))
+        //~^ try_err
     }
 
     Poll::Ready(None)
@@ -149,6 +159,7 @@ pub fn poll_next(ready: bool) -> Poll<Option<io::Result<()>>> {
 pub fn try_return(x: bool) -> Result<i32, i32> {
     if x {
         return Err(42);
+        //~^ try_err
     }
     Ok(0)
 }