Deprecated warnings in cargo output for rustc-serialize feature #174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately due to rust-lang/rust#39935 placing the annotation on the
impl
sof
Encodable
/Decodable
for the various items have no effect whatsoever, sowe need to place it on some type that chrono actually uses internally. The only
type that I can find that only exists for rustc-serialize only is the
TsSeconds
struct.So, marking TsSeconds deprecated causes Chrono's internal uses of
TsSeconds
to emit deprecation warnings, both in our builds and for packages that specify
Chrono as a dependency with the
rustc-serialize
feature active. This meansthat the current commit will cause a
warning: use of deprecated item: RustcSerialize will be removed before chrono 1.0, use Serde instead
to appearin
cargo build
output.Unfortunately I don't think that it's possible for downstream crates to disable
the warning the warning in any way other than actually switching to Serde or
using an older chrono. That's the reason for all the
#[allow(deprecated)]
through the code, it means that the warning appears almost exactly once,
instead of dozens of times.