Skip to content
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

Implement Error::source on IntoStringError + Remove superfluous cause impls #65366

Merged
merged 2 commits into from
Oct 13, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ impl Error for IntoStringError {
"C string contained non-utf8 bytes"
}

fn cause(&self) -> Option<&dyn Error> {
fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(&self.error)
}
}
Expand Down
20 changes: 0 additions & 20 deletions src/libstd/sync/mpsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1581,10 +1581,6 @@ impl<T: Send> error::Error for SendError<T> {
fn description(&self) -> &str {
"sending on a closed channel"
}

fn cause(&self) -> Option<&dyn error::Error> {
None
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1624,10 +1620,6 @@ impl<T: Send> error::Error for TrySendError<T> {
}
}
}

fn cause(&self) -> Option<&dyn error::Error> {
None
}
}

#[stable(feature = "mpsc_error_conversions", since = "1.24.0")]
Expand All @@ -1652,10 +1644,6 @@ impl error::Error for RecvError {
fn description(&self) -> &str {
"receiving on a closed channel"
}

fn cause(&self) -> Option<&dyn error::Error> {
None
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1685,10 +1673,6 @@ impl error::Error for TryRecvError {
}
}
}

fn cause(&self) -> Option<&dyn error::Error> {
None
}
}

#[stable(feature = "mpsc_error_conversions", since = "1.24.0")]
Expand Down Expand Up @@ -1726,10 +1710,6 @@ impl error::Error for RecvTimeoutError {
}
}
}

fn cause(&self) -> Option<&dyn error::Error> {
None
}
}

#[stable(feature = "mpsc_error_conversions", since = "1.24.0")]
Expand Down