Skip to content
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: 8 additions & 1 deletion library/std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod repr_unpacked;
#[cfg(not(target_pointer_width = "64"))]
use repr_unpacked::Repr;

use crate::convert::From;
use crate::convert::{From, Infallible};
use crate::error;
use crate::fmt;
use crate::result;
Expand Down Expand Up @@ -465,6 +465,13 @@ impl From<ErrorKind> for Error {
}
}

#[stable(feature = "io_error_from_infallible", since = "1.65.0")]
impl From<Infallible> for Error {
fn from(infallible: Infallible) -> Error {
match infallible {}
}
}

impl Error {
/// Creates a new I/O error from a known kind of error as well as an
/// arbitrary error payload.
Expand Down