]> git.lizzy.rs Git - rust.git/blob - src/test/ui/option-to-result.rs
Rollup merge of #72279 - RalfJung:raw-ref-macros, r=nikomatsakis
[rust.git] / src / test / ui / option-to-result.rs
1 fn main(){ }
2
3 fn test_result() -> Result<(),()> {
4     let a:Option<()> = Some(());
5     a?;//~ ERROR `?` couldn't convert the error
6     Ok(())
7 }
8
9 fn test_option() -> Option<i32>{
10     let a:Result<i32, i32> = Ok(5);
11     a?;//~ ERROR `?` couldn't convert the error
12     Some(5)
13 }