Guess head span of async blocks
This commit is contained in:
parent
7fd9c7e6de
commit
5518d1931d
4 changed files with 6 additions and 16 deletions
|
@ -1680,6 +1680,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
|||
));
|
||||
|
||||
let original_span = err.span.primary_span().unwrap();
|
||||
let original_span = self.tcx.sess.source_map().guess_head_span(original_span);
|
||||
let mut span = MultiSpan::from_span(original_span);
|
||||
|
||||
let message = outer_generator
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
error: future cannot be sent between threads safely
|
||||
--> $DIR/issue-64130-4-async-move.rs:17:5
|
||||
|
|
||||
LL | / async move {
|
||||
LL | |
|
||||
LL | | match client.status() {
|
||||
LL | | 200 => {
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_____^ future created by async block is not `Send`
|
||||
LL | async move {
|
||||
| ^^^^^^^^^^ future created by async block is not `Send`
|
||||
|
|
||||
= help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
|
||||
note: future is not `Send` as this value is used across an await
|
||||
|
|
|
@ -2,7 +2,7 @@ error: future cannot be sent between threads safely
|
|||
--> $DIR/issue-70818.rs:5:5
|
||||
|
|
||||
LL | async { (ty, ty1) }
|
||||
| ^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
||||
| ^^^^^ future created by async block is not `Send`
|
||||
|
|
||||
note: captured value is not `Send`
|
||||
--> $DIR/issue-70818.rs:5:18
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
error: future cannot be sent between threads safely
|
||||
--> $DIR/issue-70935-complex-spans.rs:11:5
|
||||
|
|
||||
LL | / async move {
|
||||
LL | |
|
||||
LL | | baz(|| async{
|
||||
LL | | foo(tx.clone());
|
||||
LL | | }).await;
|
||||
LL | | }
|
||||
| |_____^ future created by async block is not `Send`
|
||||
LL | async move {
|
||||
| ^^^^^^^^^^ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue