mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
29 lines
425 B
Rust
29 lines
425 B
Rust
//@ 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 {
|
|
foo_async(v).await
|
|
}
|
|
|
|
async fn async_main() {
|
|
let mut v = ();
|
|
|
|
let _ = bad(&mut v).await;
|
|
let _ = foo_async(&mut v).await;
|
|
let _ = bad(v).await;
|
|
}
|
|
|
|
fn main() {
|
|
let _ = async_main();
|
|
}
|