1 error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
2 --> $DIR/option-to-result.rs:5:6
4 LL | / fn test_result() -> Result<(),()> {
5 LL | | let a:Option<()> = Some(());
7 | | ^ use `.ok_or(...)?` to provide an error compatible with `Result<(), ()>`
10 | |_- this function returns a `Result`
12 = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<(), ()>`
13 = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
15 error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
16 --> $DIR/option-to-result.rs:11:6
18 LL | / fn test_option() -> Option<i32>{
19 LL | | let a:Result<i32, i32> = Ok(5);
21 | | ^ use `.ok()?` if you want to discard the `Result<Infallible, i32>` error information
24 | |_- this function returns an `Option`
26 = help: the trait `FromResidual<Result<Infallible, i32>>` is not implemented for `Option<i32>`
27 = help: the trait `FromResidual` is implemented for `Option<T>`
29 error: aborting due to 2 previous errors
31 For more information about this error, try `rustc --explain E0277`.