]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/dont-suggest-await-on-method-return-mismatch.rs
Rollup merge of #106960 - estebank:parse-anon-enums, r=cjgillot
[rust.git] / tests / ui / async-await / dont-suggest-await-on-method-return-mismatch.rs
1 // edition:2021
2
3 // Test that we do not suggest `.await` when it doesn't make sense.
4
5 struct A;
6
7 impl A {
8     fn test(&self) -> i32 {
9         1
10     }
11 }
12
13 async fn foo() -> A {
14     A
15 }
16
17 async fn async_main() {
18     let x: u32 = foo().test();
19     //~^ ERROR no method named `test` found for opaque type `impl Future<Output = A>` in the current scope
20 }
21
22 fn main() {
23     let _ = async_main();
24 }