tracing/tracing-subscriber
Eliza Weisman b21d2369c8 subscriber: fix FmtLayer's auto traits inheriting S's (#2024)
Depends on #2023

## Motivation

Currently, `FmtLayer` holds a `PhantomData<S>` with the `Subscriber`
type it wraps. This is unfortunate because it means that the
layer's auto traits such as `Send`, `Sync`, and `'static` (as well
as `UnwindSafe`, `Unpin`, etc) depend on the `Subscriber` type's auto
traits...but the layer will never actually _store_ a value of type
`S`. While all `Subscriber` will be `Send + Sync + 'static` in practice,
the `PhantomData` means that functions returning a boxed `FmtLayer`
must unnecessarily bound the subscriber type parameter.

## Solution

This commit changes the `PhantomData` to `PhantomData<fn(S)>`, solving
the problem.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2022-03-29 16:20:56 -07:00
..

Tracing — Structured, application-level diagnostics

tracing-subscriber

Utilities for implementing and composing tracing subscribers.

Crates.io Documentation Documentation (master) MIT licensed Build Status Discord chat maintenance status

Documentation | Chat

Compiler support: requires rustc 1.49+

Supported Rust Versions

Tracing is built against the latest stable release. The minimum supported version is 1.49. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version.

Tracing follows the same compiler support policies as the rest of the Tokio project. The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.45, the minimum supported version will not be increased past 1.42, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tracing by you, shall be licensed as MIT, without any additional terms or conditions.