]> git.proxmox.com Git - rustc.git/blame - src/test/ui/async-await/issue-64130-2-send.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / async-await / issue-64130-2-send.rs
CommitLineData
ba9703b0 1#![feature(negative_impls)]
60c5eb7d
XL
2// edition:2018
3
4// This tests the the specialized async-await-specific error when futures don't implement an
5// auto trait (which is specifically Send) due to some type that was captured.
6
7struct Foo;
8
9impl !Send for Foo {}
10
11fn is_send<T: Send>(t: T) { }
12
13async fn bar() {
14 let x = Foo;
15 baz().await;
16}
17
18async fn baz() { }
19
20fn main() {
21 is_send(bar());
22 //~^ ERROR future cannot be sent between threads safely
23}