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

Omit unnecessary help to add #[cfg(test)] when already annotated #96651

Merged
merged 1 commit into from
May 18, 2022
Merged

Omit unnecessary help to add #[cfg(test)] when already annotated #96651

merged 1 commit into from
May 18, 2022

Conversation

ken-matsui
Copy link
Contributor

@ken-matsui ken-matsui commented May 2, 2022

Closes: #96611

The related PR is: #91770

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 2, 2022
@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 2, 2022
Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @ken-matsui.

I believe that we can have a more robust implementation of this if we do not rely on the source_map, but rather on semantic information in the AST.

compiler/rustc_resolve/src/check_unused.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/check_unused.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/check_unused.rs Outdated Show resolved Hide resolved
@cjgillot cjgillot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 7, 2022
@ken-matsui
Copy link
Contributor Author

@cjgillot
Thank you for your review! I updated the code as reviewed.

@cjgillot
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 17, 2022

📌 Commit 03007de has been approved by cjgillot

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 17, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#96647 (rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate)
 - rust-lang#96651 (Omit unnecessary help to add `#[cfg(test)]` when already annotated)
 - rust-lang#96761 (rustdoc: don't build `rayon` for non-windows targets)
 - rust-lang#97096 (Types with reachable constructors are reachable)
 - rust-lang#97097 (Add tmm_reg clobbers)
 - rust-lang#97113 (Search GUI fixes)
 - rust-lang#97116 (interpret/validity: reject references to uninhabited types)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 78c709c into rust-lang:master May 18, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 18, 2022
@ken-matsui ken-matsui deleted the omit-unnecessary-help-to-add-cfg-test branch May 18, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler emits invalid help diagnostic when unused import is found in test module
5 participants