summaryrefslogtreecommitdiffstats
path: root/src/test/ui/try-trait/option-to-result.rs
blob: 45aaf361a9c0e0e2977e9c9770f181440bb9ceef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
fn main(){ }

fn test_result() -> Result<(),()> {
    let a:Option<()> = Some(());
    a?;//~ ERROR the `?` operator can only be used
    Ok(())
}

fn test_option() -> Option<i32>{
    let a:Result<i32, i32> = Ok(5);
    a?;//~ ERROR the `?` operator can only be used
    Some(5)
}