Allow specifying defaults for build target types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Request: allow a feature flag to be required by all benchmarks (whether this acts like dev-dependencies and affects tests too or only benchmarks does not matter).
From what I understand, currently:
- Dev-dependencies cannot be optional. source
- The required-features field can apply to specific targets (e.g.
[[bin]]or[[bench]]for a single binary)
Workaround: it appears to be possible to enable the feature for each benchmark independently, as follows:
[[bench]]
name = "distributions"
path = "benches/distributions.rs"
required-features = ["small_rng"]
[[bench]]
name = "generators"
path = "benches/generators.rs"
required-features = ["small_rng"]
...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Cargo's manifest rules for dev-dependencies and the required-features field, then compare the repeated [[bench]] workaround in the issue. Decide whether the default applies to all benchmarks or to tests as well; done means one manifest-level setting can replace repeated required-features entries and its semantics are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100