aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_ty/Cargo.toml6
-rw-r--r--crates/project_model/src/cargo_workspace.rs11
-rw-r--r--crates/project_model/src/workspace.rs2
3 files changed, 11 insertions, 8 deletions
diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml
index d0211c914..db42a00dc 100644
--- a/crates/hir_ty/Cargo.toml
+++ b/crates/hir_ty/Cargo.toml
@@ -17,9 +17,9 @@ ena = "0.14.0"
17log = "0.4.8" 17log = "0.4.8"
18rustc-hash = "1.1.0" 18rustc-hash = "1.1.0"
19scoped-tls = "1" 19scoped-tls = "1"
20chalk-solve = { version = "0.49", default-features = false } 20chalk-solve = { version = "0.50", default-features = false }
21chalk-ir = "0.49" 21chalk-ir = "0.50"
22chalk-recursive = "0.49" 22chalk-recursive = "0.50"
23la-arena = { version = "0.2.0", path = "../../lib/arena" } 23la-arena = { version = "0.2.0", path = "../../lib/arena" }
24 24
25stdx = { path = "../stdx", version = "0.0.0" } 25stdx = { path = "../stdx", version = "0.0.0" }
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);
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs
index 8e0481ae9..073c48af7 100644
--- a/crates/project_model/src/workspace.rs
+++ b/crates/project_model/src/workspace.rs
@@ -481,7 +481,7 @@ fn add_target_crate_root(
481 let edition = pkg.edition; 481 let edition = pkg.edition;
482 let cfg_options = { 482 let cfg_options = {
483 let mut opts = cfg_options.clone(); 483 let mut opts = cfg_options.clone();
484 for feature in pkg.features.iter() { 484 for feature in pkg.active_features.iter() {
485 opts.insert_key_value("feature".into(), feature.into()); 485 opts.insert_key_value("feature".into(), feature.into());
486 } 486 }
487 opts.extend(pkg.cfgs.iter().cloned()); 487 opts.extend(pkg.cfgs.iter().cloned());