2020-11-23 03:54:31 +00:00
|
|
|
#![feature(auto_traits)]
|
2020-01-09 10:56:38 +00:00
|
|
|
#![feature(negative_impls)]
|
2019-10-06 22:14:34 +00:00
|
|
|
// edition:2018
|
|
|
|
|
|
|
|
// This tests the the unspecialized async-await-specific error when futures don't implement an
|
|
|
|
// auto trait (which is not Send or Sync) due to some type that was captured.
|
|
|
|
|
|
|
|
auto trait Qux { }
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl !Qux for Foo {}
|
|
|
|
|
|
|
|
fn is_qux<T: Qux>(t: T) { }
|
|
|
|
|
|
|
|
async fn bar() {
|
|
|
|
let x = Foo;
|
|
|
|
baz().await;
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn baz() { }
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
is_qux(bar());
|
2020-09-02 07:40:56 +00:00
|
|
|
//~^ ERROR the trait bound `Foo: Qux` is not satisfied in `impl Future`
|
2019-10-06 22:14:34 +00:00
|
|
|
}
|