1 error[E0277]: `?` couldn't convert the error to `()`
2 --> $DIR/option-to-result.rs:5:6
4 LL | fn test_result() -> Result<(),()> {
5 | ------------- expected `()` because of this
6 LL | let a:Option<()> = Some(());
8 | ^ the trait `From<NoneError>` is not implemented for `()`
10 = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
11 = note: required by `from`
12 help: consider converting the `Option<T>` into a `Result<T, _>` using `Option::ok_or` or `Option::ok_or_else`
14 LL | a.ok_or_else(|| /* error value */)?;
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 error[E0277]: `?` couldn't convert the error to `NoneError`
18 --> $DIR/option-to-result.rs:11:6
20 LL | fn test_option() -> Option<i32>{
21 | ----------- expected `NoneError` because of this
22 LL | let a:Result<i32, i32> = Ok(5);
24 | ^ the trait `From<i32>` is not implemented for `NoneError`
26 = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
27 = note: required by `from`
28 help: consider converting the `Result<T, _>` into an `Option<T>` using `Result::ok`
33 error: aborting due to 2 previous errors
35 For more information about this error, try `rustc --explain E0277`.