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

Also walk bindings created by if-let guards #119402

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

est31
Copy link
Member

@est31 est31 commented Dec 29, 2023

This change makes the unused_variables lint pick up unused bindings created by if-let guards.

Fixes #119383

@rustbot
Copy link
Collaborator

rustbot commented Dec 29, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@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. labels Dec 29, 2023
@rust-log-analyzer

This comment has been minimized.

@est31 est31 force-pushed the fix_if_guard_unused branch from 264fb7f to fdec5b6 Compare December 29, 2023 02:12
@rust-log-analyzer

This comment has been minimized.

@est31 est31 force-pushed the fix_if_guard_unused branch from fdec5b6 to ab60a7d Compare December 29, 2023 02:38
@compiler-errors
Copy link
Member

r? compiler-errors @bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 29, 2023

📌 Commit ab60a7d has been approved by compiler-errors

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 Dec 29, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#119375 (Merge Coroutine lowering functions)
 - rust-lang#119393 (Use filter instead of filter_map in Parser::expected_one_of_not_found)
 - rust-lang#119401 (coverage: Avoid a possible query stability hazard in `CoverageCounters`)
 - rust-lang#119402 (Also walk bindings created by if-let guards)
 - rust-lang#119404 (Enable profiler in dist-powerpc-linux)

r? `@ghost`
`@rustbot` modify labels: rollup
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

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

r=me after the test rename

@@ -0,0 +1,9 @@
#![feature(if_let_guard)]
Copy link
Member

Choose a reason for hiding this comment

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

instead of giving this a meaningless issue number as a name, can we give it a descriptive name like "if-let-guard"?

@Noratrieb
Copy link
Member

Oh errs already reviewed it, didn't see that lol. A test rename would still be appreciated as a follow up :)

@bors bors merged commit efd9fd6 into rust-lang:master Dec 29, 2023
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Dec 29, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2023
Rollup merge of rust-lang#119402 - est31:fix_if_guard_unused, r=compiler-errors

Also walk bindings created by if-let guards

This change makes the `unused_variables` lint pick up unused bindings created by if-let guards.

Fixes rust-lang#119383
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 29, 2023
…rieb

Rename test to be more descriptive

As suggested in rust-lang#119402 (comment)

r? `@Nilstrieb`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 29, 2023
…rieb

Rename test to be more descriptive

As suggested in rust-lang#119402 (comment)

r? ``@Nilstrieb``
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2023
Rollup merge of rust-lang#119410 - est31:fix_if_guard_unused, r=Nilstrieb

Rename test to be more descriptive

As suggested in rust-lang#119402 (comment)

r? ``@Nilstrieb``
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 variables inside if-let guards don't get detected
7 participants