mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Rust: use all features by default
This commit is contained in:
committed by
Arthur Baars
parent
55be5fbf9e
commit
ca661c7877
@@ -129,6 +129,23 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
fn cargo_features(&self) -> CargoFeatures {
|
||||
// '*' is to be considered deprecated but still kept in for backward compatibility
|
||||
if self.cargo_features.is_empty() || self.cargo_features.iter().any(|f| f == "*") {
|
||||
CargoFeatures::All
|
||||
} else {
|
||||
CargoFeatures::Selected {
|
||||
features: self
|
||||
.cargo_features
|
||||
.iter()
|
||||
.filter(|f| *f != "default")
|
||||
.cloned()
|
||||
.collect(),
|
||||
no_default_features: !self.cargo_features.iter().any(|f| f == "default"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_cargo_config(&self, dir: &AbsPath) -> (CargoConfig, LoadCargoConfig) {
|
||||
let sysroot = self.sysroot(dir);
|
||||
(
|
||||
@@ -159,16 +176,7 @@ impl Config {
|
||||
.unwrap_or_else(|| self.scratch_dir.join("target")),
|
||||
)
|
||||
.ok(),
|
||||
features: if self.cargo_features.is_empty() {
|
||||
Default::default()
|
||||
} else if self.cargo_features.contains(&"*".to_string()) {
|
||||
CargoFeatures::All
|
||||
} else {
|
||||
CargoFeatures::Selected {
|
||||
features: self.cargo_features.clone(),
|
||||
no_default_features: false,
|
||||
}
|
||||
},
|
||||
features: self.cargo_features(),
|
||||
target: self.cargo_target.clone(),
|
||||
cfg_overrides: to_cfg_overrides(&self.cargo_cfg_overrides),
|
||||
wrap_rustc_in_build_scripts: false,
|
||||
|
||||
Reference in New Issue
Block a user