]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-55809.rs
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / issue-55809.rs
1 // edition:2018
2 // run-pass
3
4 trait Foo { }
5
6 impl Foo for () { }
7
8 impl<'a, T> Foo for &'a mut T where T: Foo { }
9
10 async fn foo_async<T>(_v: T) -> u8 where T: Foo {
11     0
12 }
13
14 async fn bad<T>(v: T) -> u8 where T: Foo {
15     foo_async(v).await
16 }
17
18 async fn async_main() {
19     let mut v = ();
20
21     let _ = bad(&mut v).await;
22     let _ = foo_async(&mut v).await;
23     let _ = bad(v).await;
24 }
25
26 fn main() {
27     let _ = async_main();
28 }