Closed
Description
Code
loop {
break Some(1);
}
Current output
error[E0308]: mismatched types
--> src\main.rs:24:15
|
24 | break Some(1);
| ^^^^^^^ expected `()`, found `Option<{integer}>`
|
= note: expected unit type `()`
found enum `Option<{integer}>`
error: aborting due to previous error
Desired output
loop value is never used so
break expected unit type `()`
found enum `Option<{integer}>`
Rationale and extra context
It might not be too hard to figure what the issue is in such a simple example as the above, but when you have multiple levels of nesting with complex layered types, this can quickly become a source of frustration as it sends you on a wild chase of misdirection.
Other cases
No response
Anything else?
No response