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

make unused_imports less assertive in test modules #121580

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

Suyashtnt
Copy link
Contributor

@Suyashtnt Suyashtnt commented Feb 25, 2024

closes #121502

This is a fairly small change and I used the fix suggested in the example expected error message.
Not sure if I should've rather used the alternatives but this one seems the most descriptive.

Some alternatives:

  • if this is meant to be a test module, add #[cfg(test)] to the containing module
  • try adding #[cfg(test)] to this test module
  • consider adding #[allow(unused_imports)] if you want to silent the lint on the unused import
  • consider removing the unused import

@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 25, 2024
@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 25, 2024
@michaelwoerister
Copy link
Member

Thanks for the PR, @Suyashtnt! Looks good to me.
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 1, 2024

📌 Commit 748c615 has been approved by michaelwoerister

It is now in the queue for this repository.

@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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2024
…iaskrgr

Rollup of 12 pull requests

Successful merges:

 - rust-lang#120646 (Fix incorrect suggestion for uninitialized binding in pattern)
 - rust-lang#121416 (Improve error messages for generics with default parameters)
 - rust-lang#121475 (Add tidy check for .stderr/.stdout files for non-existent test revisions)
 - rust-lang#121580 (make unused_imports less assertive in test modules)
 - rust-lang#121736 (Remove `Mutex::unlock` Function)
 - rust-lang#121784 (Make the success arms of `if lhs || rhs` meet up in a separate block)
 - rust-lang#121818 (CFI: Remove unused `typeid_for_fnsig`)
 - rust-lang#121819 (Handle stashing of delayed bugs)
 - rust-lang#121828 (Remove unused fluent messages)
 - rust-lang#121831 (Fix typo in comment)
 - rust-lang#121850 (Make `ZeroablePrimitive` trait unsafe.)
 - rust-lang#121853 (normalizes-to: handle negative impls)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 58825b4 into rust-lang:master Mar 1, 2024
22 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 1, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2024
Rollup merge of rust-lang#121580 - Suyashtnt:issue-121502-fix, r=michaelwoerister

make unused_imports less assertive in test modules

closes rust-lang#121502

This is a fairly small change and I used the fix suggested in the example expected error message.
Not sure if I should've rather used the alternatives but this one seems the most descriptive.

Some alternatives:
- if this is meant to be a test module, add `#[cfg(test)]` to the containing module
- try adding #[cfg(test)] to this test module
- consider adding #[allow(unused_imports)] if you want to silent the lint on the unused import
- consider removing the unused import
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.

unused_imports lint help on module named tests_* too assertive and potentially confusing
4 participants