]> git.lizzy.rs Git - rust.git/commitdiff
Fix mega bug
authorAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 21 Jan 2021 13:37:08 +0000 (16:37 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 21 Jan 2021 13:37:46 +0000 (16:37 +0300)
https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Manual.20content.20is.20duplicated

xtask/src/codegen/gen_assists_docs.rs
xtask/src/codegen/gen_diagnostic_docs.rs
xtask/src/codegen/gen_feature_docs.rs
xtask/src/lib.rs
xtask/tests/tidy.rs

index 6e18a50a638164d1e8213f4eab10181b26132852..51f58180c61bfcc31f43922fa3fead56468751ad 100644 (file)
@@ -4,7 +4,7 @@
 
 use crate::{
     codegen::{self, extract_comment_blocks_with_empty_lines, reformat, Location, Mode, PREAMBLE},
-    project_root, rust_files, Result,
+    project_root, rust_files_in, Result,
 };
 
 pub fn generate_assists_tests(mode: Mode) -> Result<()> {
@@ -32,7 +32,7 @@ struct Assist {
 impl Assist {
     fn collect() -> Result<Vec<Assist>> {
         let mut res = Vec::new();
-        for path in rust_files(&project_root().join("crates/assists/src/handlers")) {
+        for path in rust_files_in(&project_root().join("crates/assists/src/handlers")) {
             collect_file(&mut res, path.as_path())?;
         }
         res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id));
index 00aaea5b7755b324a156bff3ddc0dc6591aa2051..7c14d4a077d529bccbc9a9149afc8735a9f02cbe 100644 (file)
@@ -27,7 +27,7 @@ struct Diagnostic {
 impl Diagnostic {
     fn collect() -> Result<Vec<Diagnostic>> {
         let mut res = Vec::new();
-        for path in rust_files(&project_root()) {
+        for path in rust_files() {
             collect_file(&mut res, path)?;
         }
         res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id));
index 065dd33f15486714268397658656d104d940e327..61081063b75e4ef15e87ce1a46aa62b804d80042 100644 (file)
@@ -26,7 +26,7 @@ struct Feature {
 impl Feature {
     fn collect() -> Result<Vec<Feature>> {
         let mut res = Vec::new();
-        for path in rust_files(&project_root()) {
+        for path in rust_files() {
             collect_file(&mut res, path)?;
         }
         res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id));
index babec2dbd000f66f1f7b51edf67d15f71474b763..16b06b853b83ec68c68762bb0496e7046fbc30f2 100644 (file)
@@ -34,7 +34,11 @@ pub fn project_root() -> PathBuf {
     .to_path_buf()
 }
 
-pub fn rust_files(path: &Path) -> impl Iterator<Item = PathBuf> {
+pub fn rust_files() -> impl Iterator<Item = PathBuf> {
+    rust_files_in(&project_root().join("crates"))
+}
+
+pub fn rust_files_in(path: &Path) -> impl Iterator<Item = PathBuf> {
     let iter = WalkDir::new(path);
     return iter
         .into_iter()
index 6abad189adfadb1d4df6013606aaedfa9bf41c25..9a6933b094db5b4174fbf9df655a6dda57854646 100644 (file)
@@ -82,7 +82,7 @@ fn check_lsp_extensions_docs() {
 #[test]
 fn rust_files_are_tidy() {
     let mut tidy_docs = TidyDocs::default();
-    for path in rust_files(&project_root().join("crates")) {
+    for path in rust_files() {
         let text = read_file(&path).unwrap();
         check_todo(&path, &text);
         check_dbg(&path, &text);