Skip to content

Commit 911c178

Browse files
committed
Update issue-70935-complex-spans.rs
1 parent 5114cf3 commit 911c178

3 files changed

+11
-10
lines changed

src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0277]: `Sender<i32>` cannot be shared between threads safely
2-
--> $DIR/issue-70935-complex-spans.rs:12:45
2+
--> $DIR/issue-70935-complex-spans.rs:13:45
33
|
44
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
55
| ^^^^^^^^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
66
|
77
= help: the trait `Sync` is not implemented for `Sender<i32>`
88
= note: required for `&Sender<i32>` to implement `Send`
99
note: required because it's used within this closure
10-
--> $DIR/issue-70935-complex-spans.rs:16:13
10+
--> $DIR/issue-70935-complex-spans.rs:17:13
1111
|
1212
LL | baz(|| async{
1313
| ^^
1414
note: required because it's used within this `async fn` body
15-
--> $DIR/issue-70935-complex-spans.rs:9:67
15+
--> $DIR/issue-70935-complex-spans.rs:10:67
1616
|
1717
LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
1818
| ___________________________________________________________________^
1919
LL | | }
2020
| |_^
2121
= note: required because it captures the following types: `ResumeTy`, `impl for<'r, 's, 't0> Future<Output = ()>`, `()`
2222
note: required because it's used within this `async` block
23-
--> $DIR/issue-70935-complex-spans.rs:15:16
23+
--> $DIR/issue-70935-complex-spans.rs:16:16
2424
|
2525
LL | async move {
2626
| ________________^

src/test/ui/async-await/issue-70935-complex-spans.normal.stderr renamed to src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
error: future cannot be sent between threads safely
2-
--> $DIR/issue-70935-complex-spans.rs:12:45
2+
--> $DIR/issue-70935-complex-spans.rs:13:45
33
|
44
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
55
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
66
|
77
= help: the trait `Sync` is not implemented for `Sender<i32>`
88
note: future is not `Send` as this value is used across an await
9-
--> $DIR/issue-70935-complex-spans.rs:18:11
9+
--> $DIR/issue-70935-complex-spans.rs:19:11
1010
|
1111
LL | baz(|| async{
1212
| _____________-
1313
LL | | foo(tx.clone());
1414
LL | | }).await;
1515
| | - ^^^^^^ await occurs here, with the value maybe used later
1616
| |_________|
17-
| has type `[closure@$DIR/issue-70935-complex-spans.rs:16:13: 16:15]` which is not `Send`
17+
| has type `[closure@$DIR/issue-70935-complex-spans.rs:17:13: 17:15]` which is not `Send`
1818
note: the value is later dropped here
19-
--> $DIR/issue-70935-complex-spans.rs:18:17
19+
--> $DIR/issue-70935-complex-spans.rs:19:17
2020
|
2121
LL | }).await;
2222
| ^

src/test/ui/async-await/issue-70935-complex-spans.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// edition:2018
2-
// revisions: normal drop_tracking
2+
// revisions: no_drop_tracking drop_tracking
3+
// [no_drop_tracking]compile-flags:-Zdrop-tracking=no
34
// [drop_tracking]compile-flags:-Zdrop-tracking
45
// #70935: Check if we do not emit snippet
56
// with newlines which lead complex diagnostics.
@@ -10,7 +11,7 @@ async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
1011
}
1112

1213
fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
13-
//[normal]~^ ERROR future cannot be sent between threads safely
14+
//[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
1415
//[drop_tracking]~^^ ERROR `Sender<i32>` cannot be shared between threads
1516
async move {
1617
baz(|| async{

0 commit comments

Comments
 (0)