-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate complex multispan into some notes
- Loading branch information
Showing
3 changed files
with
144 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
error: future cannot be sent between threads safely | ||
--> $DIR/issue-70935-complex-spans.rs:10:45 | ||
| | ||
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send { | ||
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` | ||
LL | | ||
LL | / async move { | ||
LL | | baz(|| async{ | ||
LL | | foo(tx.clone()); | ||
LL | | }).await; | ||
LL | | } | ||
| |_____- this returned value is of type `impl std::future::Future` | ||
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send { | ||
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` | ||
| | ||
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<i32>` | ||
= help: the trait `Sync` is not implemented for `Sender<i32>` | ||
note: future is not `Send` as this value is used across an await | ||
--> $DIR/issue-70935-complex-spans.rs:13:9 | ||
| | ||
LL | baz(|| async{ | ||
| __________^___- | ||
| | _________| | ||
| || | ||
LL | || foo(tx.clone()); | ||
LL | || }).await; | ||
| || - ^- value is later dropped here | ||
| ||_________|______| | ||
| |__________| await occurs here, with value maybe used later | ||
| has type `[closure@$DIR/issue-70935-complex-spans.rs:13:13: 15:10 tx:&std::sync::mpsc::Sender<i32>]` which is not `Send` | ||
= note: the return type of a function must have a statically known size | ||
LL | / baz(|| async{ | ||
LL | | foo(tx.clone()); | ||
LL | | }).await; | ||
| |________________^ | ||
note: first, await occurs here, with the value maybe used later | ||
--> $DIR/issue-70935-complex-spans.rs:13:9 | ||
| | ||
LL | / baz(|| async{ | ||
LL | | foo(tx.clone()); | ||
LL | | }).await; | ||
| |________________^ | ||
note: ...but, the value is later dropped here | ||
--> $DIR/issue-70935-complex-spans.rs:15:17 | ||
| | ||
LL | }).await; | ||
| ^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters