From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- third_party/rust/goblin/src/error.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'third_party/rust/goblin/src/error.rs') diff --git a/third_party/rust/goblin/src/error.rs b/third_party/rust/goblin/src/error.rs index e2dd517e15..0ec4e1e0c9 100644 --- a/third_party/rust/goblin/src/error.rs +++ b/third_party/rust/goblin/src/error.rs @@ -3,6 +3,7 @@ use alloc::string::String; use core::fmt; +use core::num::TryFromIntError; use core::result; #[cfg(feature = "std")] use std::{error, io}; @@ -42,6 +43,12 @@ impl From for Error { } } +impl From for Error { + fn from(err: TryFromIntError) -> Error { + Error::Malformed(format!("Integer do not fit: {err}")) + } +} + impl From for Error { fn from(err: scroll::Error) -> Error { Error::Scroll(err) -- cgit v1.2.3