Skip to content
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

Remove proc_macro from the tidy whitelist again #39247

Merged
merged 1 commit into from
Jan 23, 2017
Merged

Conversation

est31
Copy link
Member

@est31 est31 commented Jan 22, 2017

PR #38842 has exposed that we were missing the src/test/compile-fail-fulldeps
directory in the search for feature gate tests. Because the detection didn't
work despite the effort to name the test appropriately and add a correct
"// gate-test-proc_macro" comment, proc_macro was added to the whitelist.

We fix this little weakness in the feature gate tidy check and add
the src/test/compile-fail-fulldeps directory to the checked directories.

Part of issue #39059 .

@est31
Copy link
Member Author

est31 commented Jan 22, 2017

Adding items to the whitelist is usually not wanted, but in this case this was done to avoid a bug/missing feature, so I'd say it was legitimate.

@@ -164,13 +165,14 @@ pub fn check(path: &Path, bad: &mut bool) {
});

// FIXME get this whitelist empty.
// Especially, only remove things.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this comment (i.e. the FIXME is sufficient). @abonander and I found and modified tools/tidy/src/features.rs only after exhausting all other ways to fix the tidy error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like "Adding to this list should be avoided if possible"

@@ -71,6 +71,11 @@ fn filter_dirs(path: &Path) -> bool {
skip.iter().any(|p| path.ends_with(p))
}

fn walk_many(paths: &Vec<&Path>, skip: &mut FnMut(&Path) -> bool, f: &mut FnMut(&Path)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: paths: &[Path] would be nicer so that the call would be

walk_many(&[path.join("test/compile-fail"), path.join("test/compile-fail-fulldeps")], ...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried &[Path] originally as well, but it gave me an error that Path is not sized (doc says this too). And when I did &[&Path] it gave me a type mismatch, not being able to coerce the &Vec to the slice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type would be &[PathBuf].

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, seems that &[&Path] works with &[&path.join .... I've changed it to use that notation.

@@ -115,7 +115,8 @@ pub fn check(path: &Path, bad: &mut bool) {
}
});

super::walk(&path.join("test/compile-fail"),
super::walk_many(&vec![&path.join("test/compile-fail"),
&path.join("test/compile-fail-fulldeps")],
&mut |path| super::filter_dirs(path),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting nit: indent to the ( after walk_many

PR rust-lang#38842 has exposed that we were missing the src/test/compile-fail-fulldeps
directory in the search for feature gate tests. Because the detection didn't
work despite the effort to name the test appropriately and add a correct
"// gate-test-proc_macro" comment, proc_macro was added to the whitelist.

We fix this little weakness in the feature gate tidy check and add
the src/test/compile-fail-fulldeps directory to the checked directories.
@jseyfried
Copy link
Contributor

@est31 Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jan 22, 2017

📌 Commit e3daab0 has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Jan 23, 2017

⌛ Testing commit e3daab0 with merge 7821a9b...

bors added a commit that referenced this pull request Jan 23, 2017
Remove proc_macro from the tidy whitelist again

PR #38842 has exposed that we were missing the src/test/compile-fail-fulldeps
directory in the search for feature gate tests. Because the detection didn't
work despite the effort to name the test appropriately and add a correct
"// gate-test-proc_macro" comment, proc_macro was added to the whitelist.

We fix this little weakness in the feature gate tidy check and add
the src/test/compile-fail-fulldeps directory to the checked directories.

Part of issue #39059 .
@bors
Copy link
Contributor

bors commented Jan 23, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: jseyfried
Pushing 7821a9b to master...

@bors bors merged commit e3daab0 into rust-lang:master Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants