Skip to content

Commit 42e4007

Browse files
committed
Drop the Sized constraint on impl Error for Box<T>
Because of the implicit `Sized` constraint, `Box<Error>` does not implement `Error`, which is potentially surprising when trying to pass to a type which requires `T: Error`.
1 parent 717ac96 commit 42e4007

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl Error for char::DecodeUtf16Error {
278278
}
279279

280280
#[stable(feature = "box_error", since = "1.7.0")]
281-
impl<T: Error> Error for Box<T> {
281+
impl<T: Error + ?Sized> Error for Box<T> {
282282
fn description(&self) -> &str {
283283
Error::description(&**self)
284284
}

0 commit comments

Comments
 (0)