Update issue-70935-complex-spans.rs
This commit is contained in:
parent
5114cf38b1
commit
911c178f03
3 changed files with 11 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
error[E0277]: `Sender<i32>` cannot be shared between threads safely
|
||||
--> $DIR/issue-70935-complex-spans.rs:12:45
|
||||
--> $DIR/issue-70935-complex-spans.rs:13:45
|
||||
|
|
||||
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
|
||||
| ^^^^^^^^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
|
||||
|
@ -7,12 +7,12 @@ LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
|
|||
= help: the trait `Sync` is not implemented for `Sender<i32>`
|
||||
= note: required for `&Sender<i32>` to implement `Send`
|
||||
note: required because it's used within this closure
|
||||
--> $DIR/issue-70935-complex-spans.rs:16:13
|
||||
--> $DIR/issue-70935-complex-spans.rs:17:13
|
||||
|
|
||||
LL | baz(|| async{
|
||||
| ^^
|
||||
note: required because it's used within this `async fn` body
|
||||
--> $DIR/issue-70935-complex-spans.rs:9:67
|
||||
--> $DIR/issue-70935-complex-spans.rs:10:67
|
||||
|
|
||||
LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
|
||||
| ___________________________________________________________________^
|
||||
|
@ -20,7 +20,7 @@ LL | | }
|
|||
| |_^
|
||||
= note: required because it captures the following types: `ResumeTy`, `impl for<'r, 's, 't0> Future<Output = ()>`, `()`
|
||||
note: required because it's used within this `async` block
|
||||
--> $DIR/issue-70935-complex-spans.rs:15:16
|
||||
--> $DIR/issue-70935-complex-spans.rs:16:16
|
||||
|
|
||||
LL | async move {
|
||||
| ________________^
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
error: future cannot be sent between threads safely
|
||||
--> $DIR/issue-70935-complex-spans.rs:12:45
|
||||
--> $DIR/issue-70935-complex-spans.rs:13:45
|
||||
|
|
||||
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
|
||||
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
||||
|
|
||||
= 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:18:11
|
||||
--> $DIR/issue-70935-complex-spans.rs:19:11
|
||||
|
|
||||
LL | baz(|| async{
|
||||
| _____________-
|
||||
|
@ -14,9 +14,9 @@ LL | | foo(tx.clone());
|
|||
LL | | }).await;
|
||||
| | - ^^^^^^ await occurs here, with the value maybe used later
|
||||
| |_________|
|
||||
| has type `[closure@$DIR/issue-70935-complex-spans.rs:16:13: 16:15]` which is not `Send`
|
||||
| has type `[closure@$DIR/issue-70935-complex-spans.rs:17:13: 17:15]` which is not `Send`
|
||||
note: the value is later dropped here
|
||||
--> $DIR/issue-70935-complex-spans.rs:18:17
|
||||
--> $DIR/issue-70935-complex-spans.rs:19:17
|
||||
|
|
||||
LL | }).await;
|
||||
| ^
|
|
@ -1,5 +1,6 @@
|
|||
// edition:2018
|
||||
// revisions: normal drop_tracking
|
||||
// revisions: no_drop_tracking drop_tracking
|
||||
// [no_drop_tracking]compile-flags:-Zdrop-tracking=no
|
||||
// [drop_tracking]compile-flags:-Zdrop-tracking
|
||||
// #70935: Check if we do not emit snippet
|
||||
// with newlines which lead complex diagnostics.
|
||||
|
@ -10,7 +11,7 @@ async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
|
|||
}
|
||||
|
||||
fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
|
||||
//[normal]~^ ERROR future cannot be sent between threads safely
|
||||
//[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
|
||||
//[drop_tracking]~^^ ERROR `Sender<i32>` cannot be shared between threads
|
||||
async move {
|
||||
baz(|| async{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue