diff --git a/src/display.rs b/src/display.rs index 7ccdd81..7b2bf1c 100644 --- a/src/display.rs +++ b/src/display.rs @@ -13,7 +13,7 @@ pub trait AsDisplay<'a>: Sealed { impl<'a, T> AsDisplay<'a> for &T where - T: Display + 'a, + T: Display + ?Sized + 'a, { type Target = &'a T; @@ -44,7 +44,7 @@ impl<'a> AsDisplay<'a> for PathBuf { #[doc(hidden)] pub trait Sealed {} -impl Sealed for &T {} +impl Sealed for &T {} #[cfg(feature = "std")] impl Sealed for Path {} #[cfg(feature = "std")] diff --git a/tests/test_path.rs b/tests/test_path.rs index f054077..16881ae 100644 --- a/tests/test_path.rs +++ b/tests/test_path.rs @@ -22,6 +22,13 @@ enum EnumPathBuf { Read(PathBuf), } +#[derive(Error, Debug)] +#[error("{tail}")] +pub struct UnsizedError { + pub head: i32, + pub tail: str, +} + fn assert(expected: &str, value: T) { assert_eq!(expected, value.to_string()); }