diff options
Diffstat (limited to 'crates/project_model/src/cargo_workspace.rs')
-rw-r--r-- | crates/project_model/src/cargo_workspace.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs index c0ed37fc1..a09e1a9ff 100644 --- a/crates/project_model/src/cargo_workspace.rs +++ b/crates/project_model/src/cargo_workspace.rs | |||
@@ -99,8 +99,10 @@ pub struct PackageData { | |||
99 | pub dependencies: Vec<PackageDependency>, | 99 | pub dependencies: Vec<PackageDependency>, |
100 | /// Rust edition for this package | 100 | /// Rust edition for this package |
101 | pub edition: Edition, | 101 | pub edition: Edition, |
102 | /// List of features to activate | 102 | /// Features provided by the crate, mapped to the features required by that feature. |
103 | pub features: Vec<String>, | 103 | pub features: FxHashMap<String, Vec<String>>, |
104 | /// List of features enabled on this package | ||
105 | pub active_features: Vec<String>, | ||
104 | /// List of config flags defined by this package's build script | 106 | /// List of config flags defined by this package's build script |
105 | pub cfgs: Vec<CfgFlag>, | 107 | pub cfgs: Vec<CfgFlag>, |
106 | /// List of cargo-related environment variables with their value | 108 | /// List of cargo-related environment variables with their value |
@@ -281,7 +283,8 @@ impl CargoWorkspace { | |||
281 | is_member, | 283 | is_member, |
282 | edition, | 284 | edition, |
283 | dependencies: Vec::new(), | 285 | dependencies: Vec::new(), |
284 | features: Vec::new(), | 286 | features: meta_pkg.features.into_iter().collect(), |
287 | active_features: Vec::new(), | ||
285 | cfgs: cfgs.get(&id).cloned().unwrap_or_default(), | 288 | cfgs: cfgs.get(&id).cloned().unwrap_or_default(), |
286 | envs: envs.get(&id).cloned().unwrap_or_default(), | 289 | envs: envs.get(&id).cloned().unwrap_or_default(), |
287 | out_dir: out_dir_by_id.get(&id).cloned(), | 290 | out_dir: out_dir_by_id.get(&id).cloned(), |
@@ -328,7 +331,7 @@ impl CargoWorkspace { | |||
328 | let dep = PackageDependency { name: dep_node.name, pkg }; | 331 | let dep = PackageDependency { name: dep_node.name, pkg }; |
329 | packages[source].dependencies.push(dep); | 332 | packages[source].dependencies.push(dep); |
330 | } | 333 | } |
331 | packages[source].features.extend(node.features); | 334 | packages[source].active_features.extend(node.features); |
332 | } | 335 | } |
333 | 336 | ||
334 | let workspace_root = AbsPathBuf::assert(meta.workspace_root); | 337 | let workspace_root = AbsPathBuf::assert(meta.workspace_root); |