From 15311c6ce76205d0f0ec17358a242c057f84efba Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 4 Jul 2021 15:59:25 -0700 Subject: actually enforce DecodeError impl'ing std::error::Error in std builds the previous test and code only tested one concrete archtecture, and it turns out never required `std::error::Error` on `DecodeError`. --- tests/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/lib.rs b/tests/lib.rs index 8e097de..9add6e3 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -10,6 +10,17 @@ fn test_u16() { } #[test] +fn generic_error_can_bail() { + use yaxpeax_arch::{Arch, Decoder, Reader}; + + #[allow(dead_code)] + fn decode>>(data: U, decoder: &A::Decoder) -> anyhow::Result<()> { + let mut reader = data.into(); + decoder.decode(&mut reader)?; + Ok(()) + } +} +#[test] fn error_can_bail() { use yaxpeax_arch::{Arch, AddressDiff, Decoder, Reader, LengthedInstruction, Instruction, StandardDecodeError, U8Reader}; struct TestIsa {} -- cgit v1.1