Repository navigation
build(sentry): Remove unused optional serde_json dependency - #1389
Merged
Merged
Conversation
The `sentry` crate declared `serde_json` as an optional dependency, but never used it. Because the dependency was not referenced via `dep:` in `[features]`, Cargo exposed an implicit `serde_json` feature that only pulled in the unused crate. Replace the optional dependency with an empty `serde_json` feature, so existing `features = ["serde_json"]` users keep building. The feature is soft-deprecated via a `Cargo.toml` comment and a changelog entry only: Cargo has no mechanism to warn downstream users about deprecated features (build script `cargo::warning`s and lints are hidden for non-path dependencies). Removal of the feature is tracked in #1387. Fixes #1385 References #1387 Co-Authored-By: Dr. Daniel Szokenstein <[email protected]>
Co-Authored-By: Dr. Daniel Szokenstein <[email protected]>
szokeasaurusrex
enabled auto-merge (squash)
October 29, 2026 10:13
alexander-alderman-webb
approved these changes
Nov 3, 2026
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
sentrycrate declaredserde_jsonas an optional dependency but never used it. Because it wasn't referenced viadep:in[features], Cargo exposed an implicitserde_jsonfeature that only pulled in the unused crate.This replaces the optional dependency with an empty
serde_json = []feature, so anyone withfeatures = ["serde_json"]keeps building. The feature is soft-deprecated through aCargo.tomlcomment and anUnreleasedchangelog entry only. Cargo has no way to warn downstream users about deprecated features: build scriptcargo::warnings and#[deprecated]lints are hidden for non-path dependencies, so no build script or lint was added.The crate-level feature table in
sentry/src/lib.rsdoesn't listserde_json, so the crate docs and README are unchanged.Checks run locally:
cargo fmt --check,cargo check -p sentry --all-targets(default and--all-features),cargo check -p sentry --lib --tests --no-default-features --features serde_json,cargo check --workspace --all-features --all-targets --locked,cargo clippy -p sentry --all-features --tests -D warnings, andcargo test -p sentry --all-features. All pass.--all-targets --no-default-featuresfails on the examples, but it does the same onmaster.cargo metadataconfirmssentrystill exposesserde_jsonas an empty feature.Fixes #1385
Fixes RUST-311
Removal tracked in #1387
Removal tracked in RUST-313
via @szokeasaurusrex.
--
View Junior Session [Sentry]