Skip to content

Commit

Permalink
Unrolled build for rust-lang#127091
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#127091 - Sky9x:fused-error-sources-iter, r=dtolnay

impl FusedIterator and a size hint for the error sources iter

cc tracking issue rust-lang#58520
  • Loading branch information
rust-timer authored Jul 10, 2024
2 parents 7caf672 + 90cbd0b commit a741d9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,15 @@ impl<'a> Iterator for Source<'a> {
self.current = self.current.and_then(Error::source);
current
}

fn size_hint(&self) -> (usize, Option<usize>) {
if self.current.is_some() { (1, None) } else { (0, Some(0)) }
}
}

#[unstable(feature = "error_iter", issue = "58520")]
impl<'a> crate::iter::FusedIterator for Source<'a> {}

#[stable(feature = "error_by_ref", since = "1.51.0")]
impl<'a, T: Error + ?Sized> Error for &'a T {
#[allow(deprecated, deprecated_in_future)]
Expand Down

0 comments on commit a741d9a

Please sign in to comment.