blob: c04dbf4759992cebf4e4ad4e2173720e9c4040cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//@ edition:2021
async fn foo() -> Result<(), String> {
Ok(())
}
fn convert_result<T, E>(r: Result<T, E>) -> Option<T> {
None
}
fn main() -> Option<()> {
//~^ ERROR `main` has invalid return type `Option<()>`
convert_result(foo())
//~^ ERROR mismatched types
}
|