]> git.lizzy.rs Git - rust.git/blob - src/tools/tidy/src/debug_artifacts.rs
Remove individual crate checks for bootstrap in tidy
[rust.git] / src / tools / tidy / src / debug_artifacts.rs
1 //! Tidy check to prevent creation of unnecessary debug artifacts while running tests.
2
3 use std::path::{Path, PathBuf};
4
5 const GRAPHVIZ_POSTFLOW_MSG: &str = "`borrowck_graphviz_postflow` attribute in test";
6
7 pub fn check(path: &Path, bad: &mut bool) {
8     let test_dir: PathBuf = path.join("test");
9
10     super::walk(&test_dir, &mut super::filter_dirs, &mut |entry, contents| {
11         let filename = entry.path();
12         let is_rust = filename.extension().map_or(false, |ext| ext == "rs");
13         if !is_rust {
14             return;
15         }
16
17         for (i, line) in contents.lines().enumerate() {
18             if line.contains("borrowck_graphviz_postflow") {
19                 tidy_error!(bad, "{}:{}: {}", filename.display(), i + 1, GRAPHVIZ_POSTFLOW_MSG);
20             }
21         }
22     });
23 }