mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 09:36:06 +00:00
29 lines
423 B
Rust
29 lines
423 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();
|
|
}
|