diff --git a/crates/layer/src/native_layer.rs b/crates/layer/src/native_layer.rs index f82194b..0f96381 100644 --- a/crates/layer/src/native_layer.rs +++ b/crates/layer/src/native_layer.rs @@ -20,7 +20,10 @@ use crate::{debug_annotations, error, ffi_utils, flavor, ids, init}; /// system-level events. #[derive(Clone)] #[repr(transparent)] -pub struct NativeLayer { +pub struct NativeLayer +where + W: for<'w> fmt::MakeWriter<'w>, +{ inner: sync::Arc>, } @@ -43,7 +46,10 @@ struct ThreadLocalCtx { descriptor_sent: atomic::AtomicBool, } -struct Inner { +struct Inner +where + W: for<'w> fmt::MakeWriter<'w>, +{ // Mutex is held during start, stop, flush, and poll ffi_session: sync::Arc>>>, writer: sync::Arc, @@ -761,7 +767,10 @@ where } } -impl Drop for Inner { +impl Drop for Inner +where + W: for<'w> fmt::MakeWriter<'w>, +{ fn drop(&mut self) { let _ = self.flush(self.drop_flush_timeout, self.drop_poll_timeout); let _ = self.stop(); diff --git a/crates/layer/tests/kitchen_sink.rs b/crates/layer/tests/kitchen_sink.rs index c035c28..91959f5 100644 --- a/crates/layer/tests/kitchen_sink.rs +++ b/crates/layer/tests/kitchen_sink.rs @@ -76,7 +76,10 @@ data_sources: time::sleep(time::Duration::from_secs(1)).await; drop(enter); - perfetto_layer.flush(time::Duration::from_millis(1000))?; + perfetto_layer.flush( + time::Duration::from_millis(1000), + time::Duration::from_millis(1000), + )?; drop(demo_span); drop(guard); perfetto_layer.stop()?;