2019-03-13 06:38:10 -05:00
|
|
|
// edition:2018
|
|
|
|
// run-pass
|
|
|
|
|
|
|
|
trait Foo { }
|
|
|
|
|
|
|
|
impl Foo for () { }
|
|
|
|
|
|
|
|
impl<'a, T> Foo for &'a mut T where T: Foo { }
|
|
|
|
|
|
|
|
async fn foo_async<T>(_v: T) -> u8 where T: Foo {
|
|
|
|
0
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn bad<T>(v: T) -> u8 where T: Foo {
|
2019-04-18 14:55:23 -05:00
|
|
|
foo_async(v).await
|
2019-03-13 06:38:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
async fn async_main() {
|
|
|
|
let mut v = ();
|
|
|
|
|
2019-04-18 14:55:23 -05:00
|
|
|
let _ = bad(&mut v).await;
|
|
|
|
let _ = foo_async(&mut v).await;
|
|
|
|
let _ = bad(v).await;
|
2019-03-13 06:38:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = async_main();
|
|
|
|
}
|