diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-10-11 03:05:57 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-11-02 15:53:59 +0900 |
| commit | ad978e55722bdf35e5beb32fcaa52de39650f132 (patch) | |
| tree | b5238975ff35c3d3713f3268961b8df13b226386 /src/test/ui | |
| parent | c2695255a51f0f9507be7c531fdbeef237179b44 (diff) | |
Separate complex multispan into some notes
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/async-await/issue-70935-complex-spans.stderr | 40 | ||||
| -rw-r--r-- | src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr | 15 |
2 files changed, 30 insertions, 25 deletions
diff --git a/src/test/ui/async-await/issue-70935-complex-spans.stderr b/src/test/ui/async-await/issue-70935-complex-spans.stderr index d9ce038f72b..c55f8abc42d 100644 --- a/src/test/ui/async-await/issue-70935-complex-spans.stderr +++ b/src/test/ui/async-await/issue-70935-complex-spans.stderr @@ -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 diff --git a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr index e4b2725686a..6ffbcd7ea65 100644 --- a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr +++ b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr @@ -12,10 +12,17 @@ note: future is not `Send` as this value is used across an await --> $DIR/issue-65436-raw-ptr-not-send.rs:14:9 | LL | bar(Foo(std::ptr::null())).await; - | ^^^^^^^^----------------^^^^^^^^- `std::ptr::null()` is later dropped here - | | | - | | has type `*const u8` which is not `Send` - | await occurs here, with `std::ptr::null()` maybe used later + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: first, await occurs here, with `std::ptr::null()` maybe used later + --> $DIR/issue-65436-raw-ptr-not-send.rs:14:9 + | +LL | bar(Foo(std::ptr::null())).await; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...but, `std::ptr::null()` is later dropped here + --> $DIR/issue-65436-raw-ptr-not-send.rs:14:41 + | +LL | bar(Foo(std::ptr::null())).await; + | ^ help: consider moving this into a `let` binding to create a shorter lived borrow --> $DIR/issue-65436-raw-ptr-not-send.rs:14:13 | |
