From a279561d9b927d4f0715a24ae6cbca0b0625b0c4 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 6 Aug 2024 09:30:05 +0700 Subject: [PATCH] Fix `dead_code` warnings in tests. Protect code used in some tests based on features with feature checks. --- tests/test_diagnostic_source_macro.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_diagnostic_source_macro.rs b/tests/test_diagnostic_source_macro.rs index 4f15ea0..bbc2179 100644 --- a/tests/test_diagnostic_source_macro.rs +++ b/tests/test_diagnostic_source_macro.rs @@ -154,6 +154,7 @@ fn test_diagnostic_source_is_output() { assert_eq!(expected, out); } +#[cfg(feature = "fancy-no-backtrace")] #[derive(Debug, miette::Diagnostic, thiserror::Error)] #[error("A nested error happened")] struct NestedError { @@ -212,6 +213,7 @@ fn test_nested_diagnostic_source_is_output() { assert_eq!(expected, out); } +#[cfg(feature = "fancy-no-backtrace")] #[derive(Debug, miette::Diagnostic, thiserror::Error)] #[error("A multi-error happened")] struct MultiError {