Add "this has type {}
which {}" note
This commit is contained in:
parent
66226ca157
commit
2da86a1bfd
3 changed files with 17 additions and 0 deletions
|
@ -1630,6 +1630,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
err.span_note(scope_span, &format!("{} is later dropped here", snippet));
|
err.span_note(scope_span, &format!("{} is later dropped here", snippet));
|
||||||
|
err.span_note(
|
||||||
|
interior_span,
|
||||||
|
&format!("this has type `{}` which {}", target_ty, trait_explanation),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
span.push_span_label(
|
span.push_span_label(
|
||||||
yield_span,
|
yield_span,
|
||||||
|
|
|
@ -17,6 +17,14 @@ note: the value is later dropped here
|
||||||
|
|
|
|
||||||
LL | }).await;
|
LL | }).await;
|
||||||
| ^
|
| ^
|
||||||
|
note: this has type `[closure@$DIR/issue-70935-complex-spans.rs:13:13: 15:10]` which is not `Send`
|
||||||
|
--> $DIR/issue-70935-complex-spans.rs:13:13
|
||||||
|
|
|
||||||
|
LL | baz(|| async{
|
||||||
|
| _____________^
|
||||||
|
LL | | foo(tx.clone());
|
||||||
|
LL | | }).await;
|
||||||
|
| |_________^
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,11 @@ note: `std::ptr::null()` is later dropped here
|
||||||
|
|
|
|
||||||
LL | bar(Foo(std::ptr::null())).await;
|
LL | bar(Foo(std::ptr::null())).await;
|
||||||
| ^
|
| ^
|
||||||
|
note: this has type `*const u8` which is not `Send`
|
||||||
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:14:17
|
||||||
|
|
|
||||||
|
LL | bar(Foo(std::ptr::null())).await;
|
||||||
|
| ^^^^^^^^^^^^^^^^
|
||||||
help: consider moving this into a `let` binding to create a shorter lived borrow
|
help: consider moving this into a `let` binding to create a shorter lived borrow
|
||||||
--> $DIR/issue-65436-raw-ptr-not-send.rs:14:13
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:14:13
|
||||||
|
|
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue