2022-09-23 15:24:35 -05:00
|
|
|
error[E0308]: `if` and `else` have incompatible types
|
|
|
|
--> $DIR/issue-101065.rs:12:9
|
|
|
|
|
|
|
|
|
LL | let _x = if true {
|
|
|
|
| ______________-
|
|
|
|
LL | | FakeResult::Ok(FakeResult::Ok(()))
|
|
|
|
| | ---------------------------------- expected because of this
|
|
|
|
LL | | } else {
|
|
|
|
LL | | FakeResult::Ok(())
|
2023-01-02 20:00:33 -06:00
|
|
|
| | ^^^^^^^^^^^^^^^^^^ expected `FakeResult<FakeResult<()>>`, found `FakeResult<()>`
|
2022-09-23 15:24:35 -05:00
|
|
|
LL | | };
|
|
|
|
| |_____- `if` and `else` have incompatible types
|
|
|
|
|
|
|
|
|
= note: expected enum `FakeResult<FakeResult<()>>`
|
|
|
|
found enum `FakeResult<()>`
|
|
|
|
help: try wrapping the expression in `FakeResult::Ok`
|
|
|
|
|
|
|
|
|
LL | FakeResult::Ok(FakeResult::Ok(()))
|
|
|
|
| +++++++++++++++ +
|
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2022-09-23 15:24:35 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|