about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJiahao XU <Jiahao_XU@outlook.com>2022-06-22 22:01:21 +1000
committerJiahao XU <Jiahao_XU@outlook.com>2022-06-22 22:01:21 +1000
commitd11ff2a06e7977685c9f093ec667301d3e5f63c8 (patch)
tree3baf6b23e7b411b45f2a0da724d0c3cfab781699
parent89a0783f1c8fef46b1c8de57dc611a1d753bf0d5 (diff)
downloadrust-d11ff2a06e7977685c9f093ec667301d3e5f63c8.tar.gz
rust-d11ff2a06e7977685c9f093ec667301d3e5f63c8.zip
Impl `io::error::repr_unpacked::Repr::new`
that accepts `ErrorData<Box<Custom>>`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
-rw-r--r--library/std/src/io/error/repr_unpacked.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/io/error/repr_unpacked.rs b/library/std/src/io/error/repr_unpacked.rs
index 3729c039c42..d6ad55b99f5 100644
--- a/library/std/src/io/error/repr_unpacked.rs
+++ b/library/std/src/io/error/repr_unpacked.rs
@@ -10,6 +10,10 @@ type Inner = ErrorData<Box<Custom>>;
 pub(super) struct Repr(Inner);
 
 impl Repr {
+    #[inline]
+    pub(super) fn new(dat: ErrorData<Box<Custom>>) -> Self {
+        Self(dat)
+    }
     pub(super) fn new_custom(b: Box<Custom>) -> Self {
         Self(Inner::Custom(b))
     }