External Publication
Visit Post

Add an implementation for the Default trait for std::ops::ControlFlow

Rust Internals [Unofficial] April 22, 2026
Source

Isn't ControlFlow used in situations where it's ambiguous whether the "normal"/"successful" behavior is breaking or continuing? This seems to me like it would have a significant risk of being the wrong default; and returning Continue in particular could cause an unintended infinite loop. It also would not be good for readability, because understanding the resulting control flow requires knowing the answer to the question "what does Default do?".

Discussion in the ATmosphere

Loading comments...