File tree Expand file tree Collapse file tree 3 files changed +3
-81
lines changed Expand file tree Collapse file tree 3 files changed +3
-81
lines changed Original file line number Diff line number Diff line change @@ -203,35 +203,8 @@ async fn async_borrows_but_not_last(value: bool) -> String {
203203}
204204
205205async fn async_test_return_in_macro() {
206- // This will return and the macro below won't be executed. Removing the `return` from the macro
207- // will change semantics.
208206 needed_return!(10);
209207 needed_return!(0);
210208}
211209
212- mod async_issue6501 {
213- async fn foo(bar: Result<(), ()>) {
214- bar.unwrap_or_else(|_| {})
215- }
216-
217- async fn async_test_closure() {
218- let _ = || {
219-
220- };
221- let _ = || {};
222- }
223-
224- struct Foo;
225- #[allow(clippy::unnecessary_lazy_evaluations)]
226- async fn bar(res: Result<Foo, u8>) -> Foo {
227- res.unwrap_or_else(|_| Foo)
228- }
229- }
230-
231- fn main() {
232- let _ = test_end_of_fn();
233- let _ = test_no_semicolon();
234- let _ = test_if_block();
235- let _ = test_match(true);
236- test_closure();
237- }
210+ fn main() {}
Original file line number Diff line number Diff line change @@ -203,35 +203,8 @@ async fn async_borrows_but_not_last(value: bool) -> String {
203203}
204204
205205async fn async_test_return_in_macro ( ) {
206- // This will return and the macro below won't be executed. Removing the `return` from the macro
207- // will change semantics.
208206 needed_return ! ( 10 ) ;
209207 needed_return ! ( 0 ) ;
210208}
211209
212- mod async_issue6501 {
213- async fn foo ( bar : Result < ( ) , ( ) > ) {
214- bar. unwrap_or_else ( |_| return )
215- }
216-
217- async fn async_test_closure ( ) {
218- let _ = || {
219- return ;
220- } ;
221- let _ = || return ;
222- }
223-
224- struct Foo ;
225- #[ allow( clippy:: unnecessary_lazy_evaluations) ]
226- async fn bar ( res : Result < Foo , u8 > ) -> Foo {
227- res. unwrap_or_else ( |_| return Foo )
228- }
229- }
230-
231- fn main ( ) {
232- let _ = test_end_of_fn ( ) ;
233- let _ = test_no_semicolon ( ) ;
234- let _ = test_if_block ( ) ;
235- let _ = test_match ( true ) ;
236- test_closure ( ) ;
237- }
210+ fn main ( ) { }
Original file line number Diff line number Diff line change @@ -192,29 +192,5 @@ error: unneeded `return` statement
192192LL | return String::new();
193193 | ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::new()`
194194
195- error: unneeded `return` statement
196- --> $DIR/needless_return.rs:214:32
197- |
198- LL | bar.unwrap_or_else(|_| return)
199- | ^^^^^^ help: replace `return` with an empty block: `{}`
200-
201- error: unneeded `return` statement
202- --> $DIR/needless_return.rs:219:13
203- |
204- LL | return;
205- | ^^^^^^^ help: remove `return`
206-
207- error: unneeded `return` statement
208- --> $DIR/needless_return.rs:221:20
209- |
210- LL | let _ = || return;
211- | ^^^^^^ help: replace `return` with an empty block: `{}`
212-
213- error: unneeded `return` statement
214- --> $DIR/needless_return.rs:227:32
215- |
216- LL | res.unwrap_or_else(|_| return Foo)
217- | ^^^^^^^^^^ help: remove `return`: `Foo`
218-
219- error: aborting due to 36 previous errors
195+ error: aborting due to 32 previous errors
220196
You can’t perform that action at this time.
0 commit comments