papercut: cargo does not provide feedback when using a cfg(feature = "...")
that is not declared in Cargo.toml
#10102
Labels
C-bug
Category: bug
Problem
Rust code in a crate can use
cfg(feature = "...")
attributes even if those features are not defined inCargo.toml
.I would expect this to be an error or a warning.
Steps
git clone https://github.com/artichoke/intaglio.git cd intaglio/benchmarks git checkout 28dc9784a59336aac5b879a9c90a56b85bee4216 cargo bench
Then observe that none of the
bytes
benches are ran.This was fixed after stumbling upon this code during an ad hoc review:
bytes::SymbolTable
artichoke/intaglio#114Possible Solution(s)
Emit a warning when Rust sources use a
cfg(feature = "...")
attribute for a feature that cargo will never pass for the crate because it is not declared inCargo.toml
.Notes
No response
Version
The text was updated successfully, but these errors were encountered: