Skip to content

stabilize std::error::<dyn Error>::chain() and std::error::Chain #66448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/libstd/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ impl dyn Error {
/// # Examples
///
/// ```
/// #![feature(error_iter)]
/// use std::error::Error;
/// use std::fmt;
///
Expand Down Expand Up @@ -775,7 +774,7 @@ impl dyn Error {
/// ```
///
/// [`source`]: trait.Error.html#method.source
#[unstable(feature = "error_iter", issue = "58520")]
#[stable(feature = "error_iter", since = "1.41.0")]
#[inline]
pub fn chain(&self) -> Chain<'_> {
Chain {
Expand All @@ -790,13 +789,13 @@ impl dyn Error {
/// its sources, use `skip(1)`.
///
/// [`Error`]: trait.Error.html
#[unstable(feature = "error_iter", issue = "58520")]
#[derive(Copy, Clone, Debug)]
#[stable(feature = "error_iter", since = "1.41.0")]
#[derive(Clone, Debug)]
pub struct Chain<'a> {
current: Option<&'a (dyn Error + 'static)>,
}

#[unstable(feature = "error_iter", issue = "58520")]
#[stable(feature = "error_iter", since = "1.41.0")]
impl<'a> Iterator for Chain<'a> {
type Item = &'a (dyn Error + 'static);

Expand Down