diff options
| author | bors <bors@rust-lang.org> | 2023-08-26 06:09:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-26 06:09:32 +0000 |
| commit | adb16d5ebd576188e5a4d49f3597e32acbf90e00 (patch) | |
| tree | 55a62521a94bc3399a3d755f55435826392439d1 /library/std/src/io/error.rs | |
| parent | 0154f6c8108156d4835823d123d394abbf2ea741 (diff) | |
| parent | ec91a2361ba0de6aa90f92fe620d49ef84b177ef (diff) | |
Auto merge of #3038 - rust-lang:rustup-2023-08-26, r=RalfJung
Automatic sync from rustc
Diffstat (limited to 'library/std/src/io/error.rs')
| -rw-r--r-- | library/std/src/io/error.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index 34c0ce9dcf8..d6fce4ee78f 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -916,6 +916,16 @@ impl Error { ErrorData::SimpleMessage(m) => m.kind, } } + + #[inline] + pub(crate) fn is_interrupted(&self) -> bool { + match self.repr.data() { + ErrorData::Os(code) => sys::is_interrupted(code), + ErrorData::Custom(c) => c.kind == ErrorKind::Interrupted, + ErrorData::Simple(kind) => kind == ErrorKind::Interrupted, + ErrorData::SimpleMessage(m) => m.kind == ErrorKind::Interrupted, + } + } } impl fmt::Debug for Repr { |
