1 //! Tidy check to prevent creation of unnecessary debug artifacts while running tests.
3 use crate::walk::{filter_dirs, walk};
4 use std::path::{Path, PathBuf};
6 const GRAPHVIZ_POSTFLOW_MSG: &str = "`borrowck_graphviz_postflow` attribute in test";
8 pub fn check(path: &Path, bad: &mut bool) {
9 let test_dir: PathBuf = path.join("test");
11 walk(&test_dir, &mut filter_dirs, &mut |entry, contents| {
12 let filename = entry.path();
13 let is_rust = filename.extension().map_or(false, |ext| ext == "rs");
18 for (i, line) in contents.lines().enumerate() {
19 if line.contains("borrowck_graphviz_postflow") {
20 tidy_error!(bad, "{}:{}: {}", filename.display(), i + 1, GRAPHVIZ_POSTFLOW_MSG);