aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock16
-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
-rw-r--r--xtask/src/codegen/gen_assists_docs.rs4
-rw-r--r--xtask/src/codegen/gen_diagnostic_docs.rs2
-rw-r--r--xtask/src/codegen/gen_feature_docs.rs2
-rw-r--r--xtask/src/lib.rs6
-rw-r--r--xtask/tests/tidy.rs2
9 files changed, 29 insertions, 22 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a58ab3b66..6e25d4f86 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -175,9 +175,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
175 175
176[[package]] 176[[package]]
177name = "chalk-derive" 177name = "chalk-derive"
178version = "0.49.0" 178version = "0.50.0"
179source = "registry+https://github.com/rust-lang/crates.io-index" 179source = "registry+https://github.com/rust-lang/crates.io-index"
180checksum = "b2525908e120156de4bdcbaa82c01006a5d954a461f39cbce828e0a8121bc69d" 180checksum = "ac605cf409013573e971d7292d4bec6f5495b19d5f98fc9d8b1a12270c3888e0"
181dependencies = [ 181dependencies = [
182 "proc-macro2", 182 "proc-macro2",
183 "quote", 183 "quote",
@@ -187,9 +187,9 @@ dependencies = [
187 187
188[[package]] 188[[package]]
189name = "chalk-ir" 189name = "chalk-ir"
190version = "0.49.0" 190version = "0.50.0"
191source = "registry+https://github.com/rust-lang/crates.io-index" 191source = "registry+https://github.com/rust-lang/crates.io-index"
192checksum = "ac9bd1702626513103ba6019bcc1dd97be24e3ef8545c30dd754827c56b11756" 192checksum = "fa1dbfb3c2c8b67edb5cd981f720550e43579090574f786145731f90c5d401ff"
193dependencies = [ 193dependencies = [
194 "bitflags", 194 "bitflags",
195 "chalk-derive", 195 "chalk-derive",
@@ -198,9 +198,9 @@ dependencies = [
198 198
199[[package]] 199[[package]]
200name = "chalk-recursive" 200name = "chalk-recursive"
201version = "0.49.0" 201version = "0.50.0"
202source = "registry+https://github.com/rust-lang/crates.io-index" 202source = "registry+https://github.com/rust-lang/crates.io-index"
203checksum = "697f214b6131e822de23d17814264687b555b32c9e4d95ce2b1f9267d628aae7" 203checksum = "0882e2a3ba66901717a64f8bb0655e809f800ac6abed05cb605e7a41d4bf8999"
204dependencies = [ 204dependencies = [
205 "chalk-derive", 205 "chalk-derive",
206 "chalk-ir", 206 "chalk-ir",
@@ -211,9 +211,9 @@ dependencies = [
211 211
212[[package]] 212[[package]]
213name = "chalk-solve" 213name = "chalk-solve"
214version = "0.49.0" 214version = "0.50.0"
215source = "registry+https://github.com/rust-lang/crates.io-index" 215source = "registry+https://github.com/rust-lang/crates.io-index"
216checksum = "a669c4e7eb3d10e3fabebffaf473513fcf0bb14d78feefe6d8cf3b500d5d1a45" 216checksum = "0d43cce07150eac39771ff4b198537cefef744734b2218a89c682295b54cd8d0"
217dependencies = [ 217dependencies = [
218 "chalk-derive", 218 "chalk-derive",
219 "chalk-ir", 219 "chalk-ir",
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());
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs
index 6e18a50a6..51f58180c 100644
--- a/xtask/src/codegen/gen_assists_docs.rs
+++ b/xtask/src/codegen/gen_assists_docs.rs
@@ -4,7 +4,7 @@ use std::{fmt, path::Path};
4 4
5use crate::{ 5use crate::{
6 codegen::{self, extract_comment_blocks_with_empty_lines, reformat, Location, Mode, PREAMBLE}, 6 codegen::{self, extract_comment_blocks_with_empty_lines, reformat, Location, Mode, PREAMBLE},
7 project_root, rust_files, Result, 7 project_root, rust_files_in, Result,
8}; 8};
9 9
10pub fn generate_assists_tests(mode: Mode) -> Result<()> { 10pub fn generate_assists_tests(mode: Mode) -> Result<()> {
@@ -32,7 +32,7 @@ struct Assist {
32impl Assist { 32impl Assist {
33 fn collect() -> Result<Vec<Assist>> { 33 fn collect() -> Result<Vec<Assist>> {
34 let mut res = Vec::new(); 34 let mut res = Vec::new();
35 for path in rust_files(&project_root().join("crates/assists/src/handlers")) { 35 for path in rust_files_in(&project_root().join("crates/assists/src/handlers")) {
36 collect_file(&mut res, path.as_path())?; 36 collect_file(&mut res, path.as_path())?;
37 } 37 }
38 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id)); 38 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id));
diff --git a/xtask/src/codegen/gen_diagnostic_docs.rs b/xtask/src/codegen/gen_diagnostic_docs.rs
index 00aaea5b7..7c14d4a07 100644
--- a/xtask/src/codegen/gen_diagnostic_docs.rs
+++ b/xtask/src/codegen/gen_diagnostic_docs.rs
@@ -27,7 +27,7 @@ struct Diagnostic {
27impl Diagnostic { 27impl Diagnostic {
28 fn collect() -> Result<Vec<Diagnostic>> { 28 fn collect() -> Result<Vec<Diagnostic>> {
29 let mut res = Vec::new(); 29 let mut res = Vec::new();
30 for path in rust_files(&project_root()) { 30 for path in rust_files() {
31 collect_file(&mut res, path)?; 31 collect_file(&mut res, path)?;
32 } 32 }
33 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id)); 33 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id));
diff --git a/xtask/src/codegen/gen_feature_docs.rs b/xtask/src/codegen/gen_feature_docs.rs
index 065dd33f1..61081063b 100644
--- a/xtask/src/codegen/gen_feature_docs.rs
+++ b/xtask/src/codegen/gen_feature_docs.rs
@@ -26,7 +26,7 @@ struct Feature {
26impl Feature { 26impl Feature {
27 fn collect() -> Result<Vec<Feature>> { 27 fn collect() -> Result<Vec<Feature>> {
28 let mut res = Vec::new(); 28 let mut res = Vec::new();
29 for path in rust_files(&project_root()) { 29 for path in rust_files() {
30 collect_file(&mut res, path)?; 30 collect_file(&mut res, path)?;
31 } 31 }
32 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id)); 32 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id));
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs
index babec2dbd..16b06b853 100644
--- a/xtask/src/lib.rs
+++ b/xtask/src/lib.rs
@@ -34,7 +34,11 @@ pub fn project_root() -> PathBuf {
34 .to_path_buf() 34 .to_path_buf()
35} 35}
36 36
37pub fn rust_files(path: &Path) -> impl Iterator<Item = PathBuf> { 37pub fn rust_files() -> impl Iterator<Item = PathBuf> {
38 rust_files_in(&project_root().join("crates"))
39}
40
41pub fn rust_files_in(path: &Path) -> impl Iterator<Item = PathBuf> {
38 let iter = WalkDir::new(path); 42 let iter = WalkDir::new(path);
39 return iter 43 return iter
40 .into_iter() 44 .into_iter()
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs
index 6abad189a..9a6933b09 100644
--- a/xtask/tests/tidy.rs
+++ b/xtask/tests/tidy.rs
@@ -82,7 +82,7 @@ Please adjust docs/dev/lsp-extensions.md.
82#[test] 82#[test]
83fn rust_files_are_tidy() { 83fn rust_files_are_tidy() {
84 let mut tidy_docs = TidyDocs::default(); 84 let mut tidy_docs = TidyDocs::default();
85 for path in rust_files(&project_root().join("crates")) { 85 for path in rust_files() {
86 let text = read_file(&path).unwrap(); 86 let text = read_file(&path).unwrap();
87 check_todo(&path, &text); 87 check_todo(&path, &text);
88 check_dbg(&path, &text); 88 check_dbg(&path, &text);