blob: 3b271775a385175b544d67877472601f2a2afb18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// 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();
}
|