summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/issue-102605.rs
blob: 3bbdf35af8f90630a134c2876d818a95403c6941 (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
}