]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/dont-point-return-on-E0308.rs
Rollup merge of #106712 - Ezrashaw:impl-ref-trait, r=estebank
[rust.git] / tests / ui / mismatched_types / dont-point-return-on-E0308.rs
1 // edition:2021
2
3 async fn f(_: &()) {}
4 //~^ NOTE function defined here
5 //~| NOTE
6 // Second note is the span of the underlined argument, I think...
7
8 fn main() {
9     (|| async {
10         Err::<(), ()>(())?;
11         f(());
12         //~^ ERROR mismatched types
13         //~| NOTE arguments to this function are incorrect
14         //~| NOTE expected `&()`, found `()`
15         //~| HELP consider borrowing here
16         Ok::<(), ()>(())
17     })();
18 }