What degree of panic safety is expected for iterator adapters? #58170
Labels
A-iterators
Area: Iterators
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
What state(s) are iterator adapters allowed to be in after a panic, @rust-lang/libs? Obviously they need to memory safe, but how many items are they expected to have consumed? Is it even allowed to call
.next()
on an (un-fused) iterator after you called, say,.find()
on it with a closure that panicked?Asking because this has just come up in two PRs:
VecDeque::try_rfold
, also update iterator #58064 (comment)The text was updated successfully, but these errors were encountered: