Skip to content

Commit f7da7ba

Browse files
changes to tests upfront
1 parent 4d30011 commit f7da7ba

38 files changed

+632
-436
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
1313
LL | async { true }.await
1414
| ^^^^^ await occurs here, with `rc` maybe used later
1515
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
16-
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
17-
--> tests/ui/future_not_send.rs:8:39
16+
note: future is not `Send` as this value is used across an await
17+
--> tests/ui/future_not_send.rs:11:20
1818
|
1919
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
20-
| ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
20+
| ---- has type `&std::cell::Cell<usize>` which is not `Send`
21+
...
22+
LL | async { true }.await
23+
| ^^^^^ await occurs here, with `cell` maybe used later
2124
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
2225
= note: `-D clippy::future-not-send` implied by `-D warnings`
2326
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
@@ -92,11 +95,14 @@ error: future cannot be sent between threads safely
9295
LL | pub async fn public_future(&self) {
9396
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
9497
|
95-
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
96-
--> tests/ui/future_not_send.rs:49:32
98+
note: future is not `Send` as this value is used across an await
99+
--> tests/ui/future_not_send.rs:52:31
97100
|
98101
LL | pub async fn public_future(&self) {
99-
| ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
102+
| ---- has type `&Dummy` which is not `Send`
103+
...
104+
LL | self.private_future().await;
105+
| ^^^^^ await occurs here, with `self` maybe used later
100106
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
101107

102108
error: future cannot be sent between threads safely

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ error: large future with a size of 65540 bytes
3131
LL | foo().await;
3232
| ^^^^^ help: consider `Box::pin` on it: `Box::pin(foo())`
3333

34-
error: large future with a size of 49159 bytes
34+
error: large future with a size of 32774 bytes
3535
--> tests/ui/large_futures.rs:35:5
3636
|
3737
LL | calls_fut(fut).await;

src/tools/clippy/tests/ui/needless_lifetimes.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![warn(clippy::needless_lifetimes, clippy::elidable_lifetime_names)]
44
#![allow(
55
unused,
6+
clippy::await_holding_lock,
67
clippy::boxed_local,
78
clippy::extra_unused_type_parameters,
89
clippy::needless_pass_by_value,

src/tools/clippy/tests/ui/needless_lifetimes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![warn(clippy::needless_lifetimes, clippy::elidable_lifetime_names)]
44
#![allow(
55
unused,
6+
clippy::await_holding_lock,
67
clippy::boxed_local,
78
clippy::extra_unused_type_parameters,
89
clippy::needless_pass_by_value,

0 commit comments

Comments
 (0)