Skip to content

Commit d420027

Browse files
Make clippy happy
1 parent 6c9249f commit d420027

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/tools/clippy/clippy_lints/src/suspicious_operation_groupings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ fn ident_difference_expr_with_base_location(
577577
| (AssignOp(_, _, _), AssignOp(_, _, _))
578578
| (Assign(_, _, _), Assign(_, _, _))
579579
| (TryBlock(_), TryBlock(_))
580-
| (Await(_), Await(_))
580+
| (Await(_, _), Await(_, _))
581581
| (Async(_, _), Async(_, _))
582582
| (Block(_, _), Block(_, _))
583583
| (Closure(_), Closure(_))

src/tools/clippy/clippy_utils/src/ast_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
143143
(Paren(l), _) => eq_expr(l, r),
144144
(_, Paren(r)) => eq_expr(l, r),
145145
(Err, Err) => true,
146-
(Try(l), Try(r)) | (Await(l), Await(r)) => eq_expr(l, r),
146+
(Try(l), Try(r)) | (Await(l, _), Await(r, _)) => eq_expr(l, r),
147147
(Array(l), Array(r)) => over(l, r, |l, r| eq_expr(l, r)),
148148
(Tup(l), Tup(r)) => over(l, r, |l, r| eq_expr(l, r)),
149149
(Repeat(le, ls), Repeat(re, rs)) => eq_expr(le, re) && eq_expr(&ls.value, &rs.value),

src/tools/clippy/tests/ui/future_not_send.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
55
| ^^^^ future returned by `private_future` is not `Send`
66
|
77
note: future is not `Send` as this value is used across an await
8-
--> $DIR/future_not_send.rs:8:19
8+
--> $DIR/future_not_send.rs:8:20
99
|
1010
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
1111
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
1212
LL | async { true }.await
13-
| ^^^^^^ await occurs here, with `rc` maybe used later
13+
| ^^^^^ await occurs here, with `rc` maybe used later
1414
LL | }
1515
| - `rc` is later dropped here
1616
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
1717
note: future is not `Send` as this value is used across an await
18-
--> $DIR/future_not_send.rs:8:19
18+
--> $DIR/future_not_send.rs:8:20
1919
|
2020
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
2121
| ---- has type `&std::cell::Cell<usize>` which is not `Send`
2222
LL | async { true }.await
23-
| ^^^^^^ await occurs here, with `cell` maybe used later
23+
| ^^^^^ await occurs here, with `cell` maybe used later
2424
LL | }
2525
| - `cell` is later dropped here
2626
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
@@ -33,12 +33,12 @@ LL | pub async fn public_future(rc: Rc<[u8]>) {
3333
| ^ future returned by `public_future` is not `Send`
3434
|
3535
note: future is not `Send` as this value is used across an await
36-
--> $DIR/future_not_send.rs:12:19
36+
--> $DIR/future_not_send.rs:12:20
3737
|
3838
LL | pub async fn public_future(rc: Rc<[u8]>) {
3939
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
4040
LL | async { true }.await;
41-
| ^^^^^^ await occurs here, with `rc` maybe used later
41+
| ^^^^^ await occurs here, with `rc` maybe used later
4242
LL | }
4343
| - `rc` is later dropped here
4444
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
@@ -82,12 +82,12 @@ LL | async fn private_future(&self) -> usize {
8282
| ^^^^^ future returned by `private_future` is not `Send`
8383
|
8484
note: future is not `Send` as this value is used across an await
85-
--> $DIR/future_not_send.rs:35:23
85+
--> $DIR/future_not_send.rs:35:24
8686
|
8787
LL | async fn private_future(&self) -> usize {
8888
| ----- has type `&Dummy` which is not `Send`
8989
LL | async { true }.await;
90-
| ^^^^^^ await occurs here, with `&self` maybe used later
90+
| ^^^^^ await occurs here, with `&self` maybe used later
9191
LL | self.rc.len()
9292
LL | }
9393
| - `&self` is later dropped here
@@ -100,12 +100,12 @@ LL | pub async fn public_future(&self) {
100100
| ^ future returned by `public_future` is not `Send`
101101
|
102102
note: future is not `Send` as this value is used across an await
103-
--> $DIR/future_not_send.rs:40:30
103+
--> $DIR/future_not_send.rs:40:31
104104
|
105105
LL | pub async fn public_future(&self) {
106106
| ----- has type `&Dummy` which is not `Send`
107107
LL | self.private_future().await;
108-
| ^^^^^^ await occurs here, with `&self` maybe used later
108+
| ^^^^^ await occurs here, with `&self` maybe used later
109109
LL | }
110110
| - `&self` is later dropped here
111111
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
@@ -117,12 +117,12 @@ LL | async fn generic_future<T>(t: T) -> T
117117
| ^ future returned by `generic_future` is not `Send`
118118
|
119119
note: future is not `Send` as this value is used across an await
120-
--> $DIR/future_not_send.rs:54:19
120+
--> $DIR/future_not_send.rs:54:20
121121
|
122122
LL | let rt = &t;
123123
| -- has type `&T` which is not `Send`
124124
LL | async { true }.await;
125-
| ^^^^^^ await occurs here, with `rt` maybe used later
125+
| ^^^^^ await occurs here, with `rt` maybe used later
126126
LL | t
127127
LL | }
128128
| - `rt` is later dropped here

0 commit comments

Comments
 (0)