Skip to content
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

Compilation error when compiling tracing-subscriber 0.3 with time but without local-time #1683

Closed
djc opened this issue Oct 25, 2021 · 3 comments · Fixed by #1685
Closed

Comments

@djc
Copy link
Contributor

djc commented Oct 25, 2021

Bug Report

Version

│   ├── tracing v0.1.26
│   │   │   ├── tracing-attributes v0.1.15 (proc-macro)
│   │   │   └── tracing-core v0.1.21
│   │   └── tracing-subscriber v0.3.0
│   │       ├── tracing v0.1.26 (*)
│   │       └── tracing-core v0.1.21 (*)
│   │   └── tracing v0.1.26 (*)
│   ├── tracing v0.1.26 (*)
│   ├── tracing-futures v0.2.5
│   │   └── tracing v0.1.26 (*)
│   ├── tracing-subscriber v0.3.0 (*)
├── tracing v0.1.26 (*)
└── tracing-subscriber v0.3.0 (*)
├── tracing v0.1.26 (*)
├── tracing-subscriber v0.3.0 (*)

Platform

Darwin djc-2019 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Crates

tracing-subscriber

Description

Upgrading from tracing-subscriber 0.2 to 0.3, I found that just replacing the chrono feature with time did not work:

error[E0432]: unresolved import `time_crate::LocalTime`
  --> /Users/djc/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.0/src/fmt/time/mod.rs:13:22
   |
13 | pub use time_crate::{LocalTime, UtcTime};
   |                      ^^^^^^^^^ no `LocalTime` in `fmt::time::time_crate`
@hawkw
Copy link
Member

hawkw commented Oct 25, 2021

Ah, my bad --- we should have separate pub use statements for LocalTime and UtcTime, so that the LocalTime reexport requires the feature flag. I'll fix that right away.

hawkw added a commit that referenced this issue Oct 25, 2021
Currently, the `pub use` re-export for the `LocalTime` struct is enabled
whenever the "time" feature flag is enabled. However, this type only
_exists_ when the "local-time" feature flag is enabled, so enabling only
the `time` feature results in a compilation error.

This commit adds a separate `pub use` for `LocalTime` that's only
enabled when the "local-time" feature is enabled.

Fixes #1683
hawkw added a commit that referenced this issue Oct 25, 2021
…1685)

## Motivation

Currently, the `pub use` re-export for the `LocalTime` struct is enabled
whenever the "time" feature flag is enabled. However, this type only
_exists_ when the "local-time" feature flag is enabled, so enabling only
the `time` feature results in a compilation error.

## Solution

This commit adds a separate `pub use` for `LocalTime` that's only
enabled when the "local-time" feature is enabled.

Fixes #1683
hawkw added a commit that referenced this issue Oct 25, 2021
…1685)

## Motivation

Currently, the `pub use` re-export for the `LocalTime` struct is enabled
whenever the "time" feature flag is enabled. However, this type only
_exists_ when the "local-time" feature flag is enabled, so enabling only
the `time` feature results in a compilation error.

## Solution

This commit adds a separate `pub use` for `LocalTime` that's only
enabled when the "local-time" feature is enabled.

Fixes #1683
@djc
Copy link
Contributor Author

djc commented Oct 25, 2021

Thanks for the quick fix!

@hawkw
Copy link
Member

hawkw commented Oct 25, 2021

No trouble at all --- sorry for the inconvenience! I've published v0.3.1 with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants