Skip to content

Commit 716f211

Browse files
committed
Auto merge of rust-lang#116360 - compiler-errors:async-span, r=oli-obk
Point to full `async fn` for future Semi-follow-up to rust-lang#116296 (comment) cc `@asquared31415`
2 parents f107a50 + 2c525fd commit 716f211

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

tests/ui/crashes/ice-10645.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: future cannot be sent between threads safely
2-
--> $DIR/ice-10645.rs:5:35
2+
--> $DIR/ice-10645.rs:5:1
33
|
44
LL | pub async fn bar<'a, T: 'a>(_: T) {}
5-
| ^ future returned by `bar` is not `Send`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `bar` is not `Send`
66
|
77
note: captured value is not `Send`
88
--> $DIR/ice-10645.rs:5:29

tests/ui/future_not_send.stderr

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: future cannot be sent between threads safely
2-
--> $DIR/future_not_send.rs:7:62
2+
--> $DIR/future_not_send.rs:7:1
33
|
44
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
5-
| ^^^^ future returned by `private_future` is not `Send`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
66
|
77
note: future is not `Send` as this value is used across an await
88
--> $DIR/future_not_send.rs:9:20
@@ -23,10 +23,10 @@ LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
2323
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
2424

2525
error: future cannot be sent between threads safely
26-
--> $DIR/future_not_send.rs:12:42
26+
--> $DIR/future_not_send.rs:12:1
2727
|
2828
LL | pub async fn public_future(rc: Rc<[u8]>) {
29-
| ^ future returned by `public_future` is not `Send`
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
3030
|
3131
note: future is not `Send` as this value is used across an await
3232
--> $DIR/future_not_send.rs:14:20
@@ -39,10 +39,10 @@ LL | async { true }.await;
3939
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
4040

4141
error: future cannot be sent between threads safely
42-
--> $DIR/future_not_send.rs:21:63
42+
--> $DIR/future_not_send.rs:21:1
4343
|
4444
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
45-
| ^^^^ future returned by `private_future2` is not `Send`
45+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
4646
|
4747
note: captured value is not `Send`
4848
--> $DIR/future_not_send.rs:21:26
@@ -58,10 +58,10 @@ LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
5858
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
5959

6060
error: future cannot be sent between threads safely
61-
--> $DIR/future_not_send.rs:26:43
61+
--> $DIR/future_not_send.rs:26:1
6262
|
6363
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
64-
| ^ future returned by `public_future2` is not `Send`
64+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
6565
|
6666
note: captured value is not `Send`
6767
--> $DIR/future_not_send.rs:26:29
@@ -71,10 +71,10 @@ LL | pub async fn public_future2(rc: Rc<[u8]>) {}
7171
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
7272

7373
error: future cannot be sent between threads safely
74-
--> $DIR/future_not_send.rs:38:39
74+
--> $DIR/future_not_send.rs:38:5
7575
|
7676
LL | async fn private_future(&self) -> usize {
77-
| ^^^^^ future returned by `private_future` is not `Send`
77+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
7878
|
7979
note: future is not `Send` as this value is used across an await
8080
--> $DIR/future_not_send.rs:40:24
@@ -87,10 +87,10 @@ LL | async { true }.await;
8787
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
8888

8989
error: future cannot be sent between threads safely
90-
--> $DIR/future_not_send.rs:44:39
90+
--> $DIR/future_not_send.rs:44:5
9191
|
9292
LL | pub async fn public_future(&self) {
93-
| ^ future returned by `public_future` is not `Send`
93+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
9494
|
9595
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
9696
--> $DIR/future_not_send.rs:44:32
@@ -100,10 +100,13 @@ LL | pub async fn public_future(&self) {
100100
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
101101

102102
error: future cannot be sent between threads safely
103-
--> $DIR/future_not_send.rs:55:37
103+
--> $DIR/future_not_send.rs:55:1
104104
|
105-
LL | async fn generic_future<T>(t: T) -> T
106-
| ^ future returned by `generic_future` is not `Send`
105+
LL | / async fn generic_future<T>(t: T) -> T
106+
LL | |
107+
LL | | where
108+
LL | | T: Send,
109+
| |____________^ future returned by `generic_future` is not `Send`
107110
|
108111
note: future is not `Send` as this value is used across an await
109112
--> $DIR/future_not_send.rs:61:20
@@ -115,10 +118,10 @@ LL | async { true }.await;
115118
= note: `T` doesn't implement `std::marker::Sync`
116119

117120
error: future cannot be sent between threads safely
118-
--> $DIR/future_not_send.rs:73:34
121+
--> $DIR/future_not_send.rs:73:1
119122
|
120123
LL | async fn unclear_future<T>(t: T) {}
121-
| ^ future returned by `unclear_future` is not `Send`
124+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
122125
|
123126
note: captured value is not `Send`
124127
--> $DIR/future_not_send.rs:73:28

0 commit comments

Comments
 (0)