impl CargoTargetSpec {
pub(crate) fn runnable_args(
+ snap: &GlobalStateSnapshot,
spec: Option<CargoTargetSpec>,
kind: &RunnableKind,
cfgs: &[CfgExpr],
}
}
- let mut features = Vec::new();
- for cfg in cfgs {
- required_features(cfg, &mut features);
- }
- for feature in features {
- args.push("--features".to_string());
- args.push(feature);
+ if snap.config.cargo.all_features {
+ args.push("--all-features".to_string());
+ } else {
+ let mut features = Vec::new();
+ for cfg in cfgs {
+ required_features(cfg, &mut features);
+ }
+ for feature in &snap.config.cargo.features {
+ features.push(feature.clone());
+ }
+ features.dedup();
+ for feature in features {
+ args.push("--features".to_string());
+ args.push(feature);
+ }
}
Ok((args, extra_args))
let workspace_root = spec.as_ref().map(|it| it.workspace_root.clone());
let target = spec.as_ref().map(|s| s.target.clone());
let (cargo_args, executable_args) =
- CargoTargetSpec::runnable_args(spec, &runnable.kind, &runnable.cfg_exprs)?;
+ CargoTargetSpec::runnable_args(snap, spec, &runnable.kind, &runnable.cfg_exprs)?;
let label = runnable.label(target);
let location = location_link(snap, None, runnable.nav)?;