forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check all files in
src/test
for borrowck_graphviz_postflow
This attribute causes DOT files to be generated in the top-level directory. It is intended to be used only temporarily and should never appear on master. This will prevent rust-lang#65071 from occurring again.
- Loading branch information
1 parent
c491875
commit c9e361f
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//! Tidy check to prevent creation of unnecessary debug artifacts. | ||
|
||
use std::path::{Path, PathBuf}; | ||
|
||
const GRAPHVIZ_POSTFLOW_MSG: &'static str = | ||
"`borrowck_graphviz_postflow` attribute in test"; | ||
|
||
pub fn check(path: &Path, bad: &mut bool) { | ||
let test_dir: PathBuf = path.join("test"); | ||
|
||
super::walk(&test_dir, &mut super::filter_dirs, &mut |entry, contents| { | ||
let filename = entry.path(); | ||
let is_rust = filename.extension().map_or(false, |ext| ext == "rs"); | ||
if !is_rust { | ||
return; | ||
} | ||
|
||
for (i, line) in contents.lines().enumerate() { | ||
if line.contains("borrowck_graphviz_postflow") { | ||
tidy_error!(bad, "{}:{}: {}", filename.display(), i + 1, GRAPHVIZ_POSTFLOW_MSG); | ||
} | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters