about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTakayuki <takoyaki0316@gmail.com>2021-04-12 21:58:34 +0900
committerTakayuki <takoyaki0316@gmail.com>2021-04-12 21:58:34 +0900
commite6c67ad2bfd7bb9b4777bb95aea7c4ce70e2dd8a (patch)
tree51865dddfde42ed420be82fad0ee7fa1ea9e60d9
parent0218a3b12f3aca97fc018bdb1e2bf9710c75fa2b (diff)
downloadrust-e6c67ad2bfd7bb9b4777bb95aea7c4ce70e2dd8a.tar.gz
rust-e6c67ad2bfd7bb9b4777bb95aea7c4ce70e2dd8a.zip
fix limit_stderr_length error
-rw-r--r--tests/ui/needless_return.fixed29
-rw-r--r--tests/ui/needless_return.rs29
-rw-r--r--tests/ui/needless_return.stderr26
3 files changed, 3 insertions, 81 deletions
diff --git a/tests/ui/needless_return.fixed b/tests/ui/needless_return.fixed
index 70ee6e9b31a..5c4fd466c04 100644
--- a/tests/ui/needless_return.fixed
+++ b/tests/ui/needless_return.fixed
@@ -203,35 +203,8 @@ async fn async_borrows_but_not_last(value: bool) -> String {
 }
 
 async fn async_test_return_in_macro() {
-    // This will return and the macro below won't be executed. Removing the `return` from the macro
-    // will change semantics.
     needed_return!(10);
     needed_return!(0);
 }
 
-mod async_issue6501 {
-    async fn foo(bar: Result<(), ()>) {
-        bar.unwrap_or_else(|_| {})
-    }
-
-    async fn async_test_closure() {
-        let _ = || {
-            
-        };
-        let _ = || {};
-    }
-
-    struct Foo;
-    #[allow(clippy::unnecessary_lazy_evaluations)]
-    async fn bar(res: Result<Foo, u8>) -> Foo {
-        res.unwrap_or_else(|_| Foo)
-    }
-}
-
-fn main() {
-    let _ = test_end_of_fn();
-    let _ = test_no_semicolon();
-    let _ = test_if_block();
-    let _ = test_match(true);
-    test_closure();
-}
+fn main() {}
diff --git a/tests/ui/needless_return.rs b/tests/ui/needless_return.rs
index d0da17cf862..34811db7413 100644
--- a/tests/ui/needless_return.rs
+++ b/tests/ui/needless_return.rs
@@ -203,35 +203,8 @@ async fn async_borrows_but_not_last(value: bool) -> String {
 }
 
 async fn async_test_return_in_macro() {
-    // This will return and the macro below won't be executed. Removing the `return` from the macro
-    // will change semantics.
     needed_return!(10);
     needed_return!(0);
 }
 
-mod async_issue6501 {
-    async fn foo(bar: Result<(), ()>) {
-        bar.unwrap_or_else(|_| return)
-    }
-
-    async fn async_test_closure() {
-        let _ = || {
-            return;
-        };
-        let _ = || return;
-    }
-
-    struct Foo;
-    #[allow(clippy::unnecessary_lazy_evaluations)]
-    async fn bar(res: Result<Foo, u8>) -> Foo {
-        res.unwrap_or_else(|_| return Foo)
-    }
-}
-
-fn main() {
-    let _ = test_end_of_fn();
-    let _ = test_no_semicolon();
-    let _ = test_if_block();
-    let _ = test_match(true);
-    test_closure();
-}
+fn main() {}
diff --git a/tests/ui/needless_return.stderr b/tests/ui/needless_return.stderr
index 44b29361802..74dda971fda 100644
--- a/tests/ui/needless_return.stderr
+++ b/tests/ui/needless_return.stderr
@@ -192,29 +192,5 @@ error: unneeded `return` statement
 LL |         return String::new();
    |         ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::new()`
 
-error: unneeded `return` statement
-  --> $DIR/needless_return.rs:214:32
-   |
-LL |         bar.unwrap_or_else(|_| return)
-   |                                ^^^^^^ help: replace `return` with an empty block: `{}`
-
-error: unneeded `return` statement
-  --> $DIR/needless_return.rs:219:13
-   |
-LL |             return;
-   |             ^^^^^^^ help: remove `return`
-
-error: unneeded `return` statement
-  --> $DIR/needless_return.rs:221:20
-   |
-LL |         let _ = || return;
-   |                    ^^^^^^ help: replace `return` with an empty block: `{}`
-
-error: unneeded `return` statement
-  --> $DIR/needless_return.rs:227:32
-   |
-LL |         res.unwrap_or_else(|_| return Foo)
-   |                                ^^^^^^^^^^ help: remove `return`: `Foo`
-
-error: aborting due to 36 previous errors
+error: aborting due to 32 previous errors