diff --git a/tracing-core/src/field.rs b/tracing-core/src/field.rs index f9da95c99d..e3c2f5782b 100644 --- a/tracing-core/src/field.rs +++ b/tracing-core/src/field.rs @@ -433,6 +433,19 @@ where } } +impl<'a, T: ?Sized> crate::sealed::Sealed for &'a mut T where T: Value + crate::sealed::Sealed + 'a {} + +impl<'a, T: ?Sized> Value for &'a mut T +where + T: Value + 'a, +{ + fn record(&self, key: &Field, visitor: &mut dyn Visit) { + // Don't use `(*self).record(key, visitor)`, otherwise would + // cause stack overflow due to `unconditional_recursion`. + T::record(self, key, visitor) + } +} + impl<'a> crate::sealed::Sealed for fmt::Arguments<'a> {} impl<'a> Value for fmt::Arguments<'a> {