Skip to content

Commit ef3f578

Browse files
test: adjusted tests
1 parent 8ec6c3d commit ef3f578

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

tests/ui/redundant_closure_call_early.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,3 @@ fn main() {
1818
#[allow(clippy::try_err)]
1919
(|| -> Result<i32, i32> { Err(2)? })();
2020
}
21-
22-
// don't lint
23-
async fn issue_11357() {
24-
let x = (|| async {})().await;
25-
}

tests/ui/redundant_closure_call_fixable.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@ fn issue9956() {
8484
bar()(42, 5);
8585
foo(42, 5);
8686
}
87+
88+
async fn issue_11357() {
89+
let x = (async {}).await;
90+
}

tests/ui/redundant_closure_call_fixable.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@ fn issue9956() {
8484
bar()((|| || 42)()(), 5);
8585
foo((|| || 42)()(), 5);
8686
}
87+
88+
async fn issue_11357() {
89+
let x = (|| async {})().await;
90+
}

tests/ui/redundant_closure_call_fixable.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,11 @@ error: try not to call a closure in the expression where it is declared
122122
LL | foo((|| || 42)()(), 5);
123123
| ^^^^^^^^^^^^^^ help: try doing something like: `42`
124124

125-
error: aborting due to 14 previous errors
125+
error: try not to call a closure in the expression where it is declared
126+
--> $DIR/redundant_closure_call_fixable.rs:89:13
127+
|
128+
LL | let x = (|| async {})().await;
129+
| ^^^^^^^^^^^^^^^ help: try doing something like: `(async {})`
130+
131+
error: aborting due to 15 previous errors
126132

0 commit comments

Comments
 (0)