Skip to content

Remove proc_macro from the tidy whitelist again #39247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
@@ -115,9 +115,10 @@ pub fn check(path: &Path, bad: &mut bool) {
}
});

super::walk(&path.join("test/compile-fail"),
&mut |path| super::filter_dirs(path),
&mut |file| {
super::walk_many(&[&path.join("test/compile-fail"),
&path.join("test/compile-fail-fulldeps")],
&mut |path| super::filter_dirs(path),
&mut |file| {
let filename = file.file_name().unwrap().to_string_lossy();
if !filename.ends_with(".rs") || filename == "features.rs" ||
filename == "diagnostic_list.rs" {
@@ -170,7 +171,7 @@ pub fn check(path: &Path, bad: &mut bool) {
"cfg_target_has_atomic", "staged_api", "const_indexing",
"unboxed_closures", "stmt_expr_attributes",
"cfg_target_thread_local", "unwind_attributes",
"inclusive_range_syntax", "proc_macro"
"inclusive_range_syntax"
];

// Only check the number of lang features.
5 changes: 5 additions & 0 deletions src/tools/tidy/src/main.rs
Original file line number Diff line number Diff line change
@@ -71,6 +71,11 @@ fn filter_dirs(path: &Path) -> bool {
skip.iter().any(|p| path.ends_with(p))
}

fn walk_many(paths: &[&Path], skip: &mut FnMut(&Path) -> bool, f: &mut FnMut(&Path)) {
for path in paths {
walk(path, skip, f);
}
}

fn walk(path: &Path, skip: &mut FnMut(&Path) -> bool, f: &mut FnMut(&Path)) {
for entry in t!(fs::read_dir(path), path) {