-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Suggest adding a #[cfg(test)]
to a test module
#90197
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
Suggest adding a #[cfg(test)]
to a test module
#90197
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
r? @estebank |
Could you review this PR? @wesleywiser @estebank |
📌 Commit 3e43de4 has been approved by |
@wesleywiser Thank you! |
visitor.r.local_def_id(unused.use_tree_id).to_def_id(), | ||
); | ||
let test_module_span = match module_to_string(parent_module) { | ||
Some(module) if module.contains("test") => Some(parent_module.span), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If my understanding is correct, this would detect modules like the followings as 'test' module.
mod fastest_search {
// ...
}
mod sohrtest_path {
// ...
}
mod bytestring {
// ...
}
Is it intentional? I'm afraid that this loose check causes many false positives. I'd recommend to check more strictly like module == "test" || module == "tests"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wesleywiser I fixed this false positive. Could you review again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of c597dc8, it looks good to me 👍
@bors r- |
Could you review this PR again? @wesleywiser |
closes #88138