-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistently pass Dispatch as owned value #1051
base: master
Are you sure you want to change the base?
Consistently pass Dispatch as owned value #1051
Conversation
As an alternative to tokio-rs#1045, this PR switches `set_default` and `with_default` to take an owned `Dispatch` instead of a ref. See [comment here](tokio-rs#1045 (comment)) for motivation. Closes tokio-rs#455 Part of tokio-rs#922
…spatch-as-owned-tokio-rs#455 * upstream/master: (34 commits) subscriber: remove TraceLogger (tokio-rs#1052) subscriber: make Registry::enter/exit much faster (tokio-rs#1058) chore(deps): update env_logger requirement from 0.7 to 0.8 (tokio-rs#1050) chore: fix tracing-macros::dbg (tokio-rs#1054) chore(deps): update pin-project requirement from 0.4 to 1.0 (tokio-rs#1038) chore: remove duplicated section from tracing/README.md (tokio-rs#1046) opentelemetry: prepare for 0.8.0 release (tokio-rs#1036) docs: add favicon for extra pretty docs (tokio-rs#1033) subscriber: fix `reload` ergonomics (tokio-rs#1035) chore(deps): update crossbeam-channel requirement from 0.4.2 to 0.5.0 (tokio-rs#1031) opentelemetry: Assign default ids if missing (tokio-rs#1027) chore: remove deprecated add-path from CI (tokio-rs#1026) attributes: fix `#[instrument(err)]` in case of early returns (tokio-rs#1006) core: remove mandatory liballoc dependency with no-std (tokio-rs#1017) chore(deps): update cfg-if requirement from 0.1.10 to 1.0.0 (tokio-rs#1023) subscriber: warn if trying to enable a statically disabled level (tokio-rs#990) subscriber: use macros for module declarations (tokio-rs#1009) chore: remove `stdlib.rs` (tokio-rs#1008) core: fix linked list tests reusing `Registration`s (tokio-rs#1016) subscriber: support dash in target names (tokio-rs#1012) ...
…spatch-as-owned-tokio-rs#455 * upstream/master: subscriber: update sharded-slab to 0.1, pool hashmap allocations (tokio-rs#1062) subscriber: remove deprecated type, structs, and methods tokio-rs#1030 core: rename Subscriber to Collect (tokio-rs#1015) chore: fix rustdoc warning in tracing-subscriber (tokio-rs#1061)
It looks like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. I think this change (passing the Dispatch
/Subscriber
by value in all cases, rather than by ref) is the right approach.
However, I noticed a couple things we'll need to change before we can merge this:
- I think this branch needs to be rebased onto the latest master, since some modules were renamed on master. Also, there are a few merge conflicts that need to be resolved.
- I think this changes the behavior of the
tracing_subscriber::registry
tests slightly, so that they will always pass, even if the underlying behavior being tested changes. We should fix those tests by ensuring that theDispatch
is always dropped at the end of the test, not whenwith_default
finishes, by cloning it when callingwith_default
.
Thanks!
…nt to clone the Dispatch
CI failure seems spurious. |
@hawkw Is there anything else needed here? :) |
Maybe this can still be merged, will need to confirm. |
As an alternative to #1045, this PR switches
set_default
andwith_default
to take an ownedDispatch
instead of a ref.See comment here for motivation.
Closes #455
Part of #922