You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's ergonomic to include assertions and debugging helpers within the functions/methods to test, but this approach currently either requires duplication or ad-hoc abstractions to enable/disable code.
Most dead code isn't eliminated until fairly late in compilation (?)
Wonder if this will be compatible with our current use of attributes & macros. Since we collect & typecheck functions before we apply attributes to them, if a function is #[cfg(...)]'d out of the program, we'd still issue errors for it. E.g. "duplicate function with name foo", or feature-specific functions not being available within its body, etc.
Problem
See description of how features work in Rust.
Happy Case
Minimal useful version:
Nargo.toml
[features]
sectionfeature_name = ["included_feature1", "included_feature2", ..]
#[cfg(feature = "feature_name")]
on top-level declarations and filter out unused declarations after parsinglet _: bool = cfg!(feature = "feature_name");
or similar for use inside declarationsnargo
CLI option:--features "feat1 feat2"
Outside original PR:
all/any/not
incfg
default
feature--all-features
,--no-default-features
Workaround
Yes
Workaround Description
Maintain multiple versions of declarations that need different features.
Additional Context
No response
Project Impact
Nice-to-have
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: