]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/issue-70935-complex-spans.rs
2 // revisions: normal drop_tracking
3 // [drop_tracking]compile-flags:-Zdrop-tracking
4 // #70935: Check if we do not emit snippet
5 // with newlines which lead complex diagnostics.
7 use std
::future
::Future
;
9 async
fn baz
<T
>(_c
: impl FnMut() -> T
) where T
: Future
<Output
=()> {
10 //[drop_tracking]~^ within this `async fn` body
13 fn foo(tx
: std
::sync
::mpsc
::Sender
<i32>) -> impl Future
+ Send
{
14 //[normal]~^ ERROR: future cannot be sent between threads safely
15 //[drop_tracking]~^^ ERROR: `Sender<i32>` cannot be shared
16 //[drop_tracking]~| NOTE: cannot be shared
17 //[drop_tracking]~| NOTE: requirements on the impl of `Send`
18 //[drop_tracking]~| NOTE: captures the following types
19 //[drop_tracking]~| NOTE: in this expansion
20 //[drop_tracking]~| NOTE: in this expansion
21 //[drop_tracking]~| NOTE: in this expansion
22 //[drop_tracking]~| NOTE: in this expansion
24 //[drop_tracking]~^ within this `async` block
25 baz(|| async
{ //[drop_tracking]~ NOTE: used within this closure
31 fn bar(_s
: impl Future
+ Send
) {
35 let (tx
, _rx
) = std
::sync
::mpsc
::channel();