From 4271a9cd8dc8d43249f5a4febe5fea19f4dca971 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Tue, 2 Apr 2019 13:42:31 -0700 Subject: [PATCH] trace: Fix subscriber benchmarks panicking (#1028) This branch fixes the `tokio-trace` Subscriber benchmarks panicking due to constructing spans with ID 0. They will now use an arbitrary constant instead. Signed-off-by: Eliza Weisman --- tokio-trace/benches/subscriber.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio-trace/benches/subscriber.rs b/tokio-trace/benches/subscriber.rs index 745fb6ae6..34a73b8c5 100644 --- a/tokio-trace/benches/subscriber.rs +++ b/tokio-trace/benches/subscriber.rs @@ -18,7 +18,7 @@ struct EnabledSubscriber; impl tokio_trace::Subscriber for EnabledSubscriber { fn new_span(&self, span: &span::Attributes) -> Id { let _ = span; - Id::from_u64(0) + Id::from_u64(0xDEADFACE) } fn event(&self, event: &Event) { @@ -63,7 +63,7 @@ impl tokio_trace::Subscriber for VisitingSubscriber { fn new_span(&self, span: &span::Attributes) -> Id { let mut visitor = Visitor(self.0.lock().unwrap()); span.record(&mut visitor); - Id::from_u64(0) + Id::from_u64(0xDEADFACE) } fn record(&self, _span: &Id, values: &span::Record) {