error[E0308]: mismatched types | |
--> $DIR/issue-116967-cannot-coerce-returned-result.rs:3:5 | |
| | |
LL | fn foo() -> Result<String, ()> { | |
| ------------------ expected `Result<String, ()>` because of return type | |
LL | let out: Result<(), ()> = Ok(()); | |
LL | out | |
| ^^^ expected `Result<String, ()>`, found `Result<(), ()>` | |
| | |
= note: expected enum `Result<String, _>` | |
found enum `Result<(), _>` | |
error: aborting due to previous error | |
For more information about this error, try `rustc --explain E0308`. |