Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Why do all feature flags appear enabled in one file?
Hi all,
I’ve run into something puzzling and was hoping someone might point me in the right direction. I’m working in a large codebase, and while investigating a performance issue I noticed that in one particular file all feature flags appear to be enabled (this makes a certain function execute multiple versions of itself instead of just one).
Here’s the confusing part:
#[cfg(feature = "bob")]
in other nearby files (and add the flag to Cargo.toml
), VS Code correctly shows it as disabled when the feature isn’t set.Cargo.toml
.cargo clean
, but the behavior didn’t change.Does anyone know what might cause a single file to behave as if every feature flag is turned on? Where should I start looking? How should I debug this?
Thanks!
1 post - 1 participant
🏷️ Rust_feed