From d11ff2a06e7977685c9f093ec667301d3e5f63c8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 22:01:21 +1000 Subject: [PATCH] Impl `io::error::repr_unpacked::Repr::new` that accepts `ErrorData>` Signed-off-by: Jiahao XU --- library/std/src/io/error/repr_unpacked.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/std/src/io/error/repr_unpacked.rs b/library/std/src/io/error/repr_unpacked.rs index 3729c039c42d..d6ad55b99f5c 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>; pub(super) struct Repr(Inner); impl Repr { + #[inline] + pub(super) fn new(dat: ErrorData>) -> Self { + Self(dat) + } pub(super) fn new_custom(b: Box) -> Self { Self(Inner::Custom(b)) }