diff options
Diffstat (limited to 'vendor/tracing-core/src')
-rw-r--r-- | vendor/tracing-core/src/callsite.rs | 4 | ||||
-rw-r--r-- | vendor/tracing-core/src/dispatcher.rs | 4 | ||||
-rw-r--r-- | vendor/tracing-core/src/field.rs | 50 | ||||
-rw-r--r-- | vendor/tracing-core/src/lib.rs | 6 |
4 files changed, 25 insertions, 39 deletions
diff --git a/vendor/tracing-core/src/callsite.rs b/vendor/tracing-core/src/callsite.rs index f88713236..62fa8c4af 100644 --- a/vendor/tracing-core/src/callsite.rs +++ b/vendor/tracing-core/src/callsite.rs @@ -9,9 +9,7 @@ //! * Storing the span or event's [`Metadata`], //! * Uniquely [identifying](Identifier) the span or event definition, //! * Caching the subscriber's [`Interest`][^1] in that span or event, to avoid -//! re-evaluating filters, -//! * Storing a [`Registration`] that allows the callsite to be part of a global -//! list of all callsites in the program. +//! re-evaluating filters. //! //! # Registering Callsites //! diff --git a/vendor/tracing-core/src/dispatcher.rs b/vendor/tracing-core/src/dispatcher.rs index 32632abdc..de02afb79 100644 --- a/vendor/tracing-core/src/dispatcher.rs +++ b/vendor/tracing-core/src/dispatcher.rs @@ -518,8 +518,8 @@ impl Dispatch { } } - /// Registers a new callsite with this collector, returning whether or not - /// the collector is interested in being notified about the callsite. + /// Registers a new callsite with this subscriber, returning whether or not + /// the subscriber is interested in being notified about the callsite. /// /// This calls the [`register_callsite`] function on the [`Subscriber`] /// that this `Dispatch` forwards to. diff --git a/vendor/tracing-core/src/field.rs b/vendor/tracing-core/src/field.rs index 04b8e1b29..90c4eaa85 100644 --- a/vendor/tracing-core/src/field.rs +++ b/vendor/tracing-core/src/field.rs @@ -1,13 +1,13 @@ //! `Span` and `Event` key-value data. //! -//! Spans and events may be annotated with key-value data, referred to as known -//! as _fields_. These fields consist of a mapping from a key (corresponding to -//! a `&str` but represented internally as an array index) to a [`Value`]. +//! Spans and events may be annotated with key-value data, known as _fields_. +//! These fields consist of a mapping from a key (corresponding to a `&str` but +//! represented internally as an array index) to a [`Value`]. //! //! # `Value`s and `Subscriber`s //! //! `Subscriber`s consume `Value`s as fields attached to [span]s or [`Event`]s. -//! The set of field keys on a given span or is defined on its [`Metadata`]. +//! The set of field keys on a given span or event is defined on its [`Metadata`]. //! When a span is created, it provides [`Attributes`] to the `Subscriber`'s //! [`new_span`] method, containing any fields whose values were provided when //! the span was created; and may call the `Subscriber`'s [`record`] method @@ -470,6 +470,10 @@ macro_rules! impl_one_value { impl $crate::sealed::Sealed for $value_ty {} impl $crate::field::Value for $value_ty { fn record(&self, key: &$crate::field::Field, visitor: &mut dyn $crate::field::Visit) { + // `op` is always a function; the closure is used because + // sometimes there isn't a real function corresponding to that + // operation. the clippy warning is not that useful here. + #[allow(clippy::redundant_closure_call)] visitor.$record(key, $op(*self)) } } @@ -485,6 +489,10 @@ macro_rules! impl_one_value { impl $crate::sealed::Sealed for ty_to_nonzero!($value_ty) {} impl $crate::field::Value for ty_to_nonzero!($value_ty) { fn record(&self, key: &$crate::field::Field, visitor: &mut dyn $crate::field::Visit) { + // `op` is always a function; the closure is used because + // sometimes there isn't a real function corresponding to that + // operation. the clippy warning is not that useful here. + #[allow(clippy::redundant_closure_call)] visitor.$record(key, $op(self.get())) } } @@ -871,9 +879,6 @@ impl FieldSet { } /// Returns a new `ValueSet` with entries for this `FieldSet`'s values. - /// - /// Note that a `ValueSet` may not be constructed with arrays of over 32 - /// elements. #[doc(hidden)] pub fn value_set<'v, V>(&'v self, values: &'v V) -> ValueSet<'v> where @@ -1072,28 +1077,10 @@ impl<'a> fmt::Display for ValueSet<'a> { mod private { use super::*; - /// Marker trait implemented by arrays which are of valid length to - /// construct a `ValueSet`. - /// - /// `ValueSet`s may only be constructed from arrays containing 32 or fewer - /// elements, to ensure the array is small enough to always be allocated on the - /// stack. This trait is only implemented by arrays of an appropriate length, - /// ensuring that the correct size arrays are used at compile-time. + /// Restrictions on `ValueSet` lengths were removed in #2508 but this type remains for backwards compatibility. pub trait ValidLen<'a>: Borrow<[(&'a Field, Option<&'a (dyn Value + 'a)>)]> {} -} - -macro_rules! impl_valid_len { - ( $( $len:tt ),+ ) => { - $( - impl<'a> private::ValidLen<'a> for - [(&'a Field, Option<&'a (dyn Value + 'a)>); $len] {} - )+ - } -} -impl_valid_len! { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + impl<'a, const N: usize> ValidLen<'a> for [(&'a Field, Option<&'a (dyn Value + 'a)>); N] {} } #[cfg(test)] @@ -1102,8 +1089,9 @@ mod test { use crate::metadata::{Kind, Level, Metadata}; use crate::stdlib::{borrow::ToOwned, string::String}; - struct TestCallsite1; - static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1; + // Make sure TEST_CALLSITE_* have non-zero size, so they can't be located at the same address. + struct TestCallsite1(u8); + static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1(0); static TEST_META_1: Metadata<'static> = metadata! { name: "field_test1", target: module_path!(), @@ -1123,8 +1111,8 @@ mod test { } } - struct TestCallsite2; - static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2; + struct TestCallsite2(u8); + static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2(0); static TEST_META_2: Metadata<'static> = metadata! { name: "field_test2", target: module_path!(), diff --git a/vendor/tracing-core/src/lib.rs b/vendor/tracing-core/src/lib.rs index f5de4eeba..d43a6b8b0 100644 --- a/vendor/tracing-core/src/lib.rs +++ b/vendor/tracing-core/src/lib.rs @@ -243,9 +243,9 @@ macro_rules! metadata { $name, $target, $level, - Some(file!()), - Some(line!()), - Some(module_path!()), + ::core::option::Option::Some(file!()), + ::core::option::Option::Some(line!()), + ::core::option::Option::Some(module_path!()), $crate::field::FieldSet::new($fields, $crate::identify_callsite!($callsite)), $kind, ) |