We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
io::error::repr_bitpacked::Repr::new
1 parent d11ff2a commit 1713e25Copy full SHA for 1713e25
library/std/src/io/error/repr_bitpacked.rs
@@ -132,6 +132,15 @@ unsafe impl Send for Repr {}
132
unsafe impl Sync for Repr {}
133
134
impl Repr {
135
+ pub(super) fn new(dat: ErrorData<Box<Custom>>) -> Self {
136
+ match dat {
137
+ ErrorData::Os(code) => Self::new_os(code),
138
+ ErrorData::Simple(kind) => Self::new_simple(kind),
139
+ ErrorData::SimpleMessage(simple_message) => Self::new_simple_message(simple_message),
140
+ ErrorData::Custom(b) => Self::new_custom(b),
141
+ }
142
143
+
144
pub(super) fn new_custom(b: Box<Custom>) -> Self {
145
let p = Box::into_raw(b).cast::<u8>();
146
// Should only be possible if an allocator handed out a pointer with
0 commit comments