]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-55809.rs
test for #50518
[rust.git] / src / test / run-pass / issue-55809.rs
1 // edition:2018
2 // run-pass
3
4 #![feature(async_await, await_macro)]
5
6 trait Foo { }
7
8 impl Foo for () { }
9
10 impl<'a, T> Foo for &'a mut T where T: Foo { }
11
12 async fn foo_async<T>(_v: T) -> u8 where T: Foo {
13     0
14 }
15
16 async fn bad<T>(v: T) -> u8 where T: Foo {
17     await!(foo_async(v))
18 }
19
20 async fn async_main() {
21     let mut v = ();
22
23     let _ = await!(bad(&mut v));
24     let _ = await!(foo_async(&mut v));
25     let _ = await!(bad(v));
26 }
27
28 fn main() {
29     let _ = async_main();
30 }