1 error[E0308]: mismatched types
2 --> $DIR/issue-98982.rs:2:5
5 | --- expected `i32` because of return type
10 | |_____^ expected `i32`, found `()`
12 note: the function expects a value to always be returned, but loops might run zero times
13 --> $DIR/issue-98982.rs:2:5
16 | ^^^^^^^^^^^^^ this might have zero elements to iterate on
19 | -------- if the loop doesn't execute, this value would never get returned
20 = help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
22 error: aborting due to previous error
24 For more information about this error, try `rustc --explain E0308`.