Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix lint scoping for let-else. #102257

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Fix lint scoping for let-else. #102257

merged 1 commit into from
Sep 26, 2022

Conversation

cjgillot
Copy link
Contributor

The scoping for let-else is inconsistent with HIR nesting. This creates cases, in ui/let-else/let-else-allow-unused.rs for instance, where an allow lint attribute does not apply to the bindings created by let-else.

This PR is an attempt to correct this.

As there is no lint that currently relies on this, the test for this behaviour is #101500.

cc @dingxiangfei2009 as you filed #101894

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

r? @compiler-errors

(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 Sep 25, 2022
@cjgillot cjgillot changed the title Fix scoping for let-else. Fix lint scoping for let-else. Sep 25, 2022
@dingxiangfei2009
Copy link
Contributor

This looks quite right. Sorry for the confusion!

@compiler-errors
Copy link
Member

@bors r=dingxiangfei2009

@bors
Copy link
Collaborator

bors commented Sep 26, 2022

📌 Commit 73c52bc has been approved by dingxiangfei2009

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 Sep 26, 2022
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Sep 26, 2022
…gfei2009

Fix lint scoping for let-else.

The scoping for let-else is inconsistent with HIR nesting.  This creates cases, in `ui/let-else/let-else-allow-unused.rs` for instance, where an `allow` lint attribute does not apply to the bindings created by `let-else`.

This PR is an attempt to correct this.

As there is no lint that currently relies on this, the test for this behaviour is rust-lang#101500.

cc `@dingxiangfei2009` as you filed rust-lang#101894
@bors
Copy link
Collaborator

bors commented Sep 26, 2022

⌛ Testing commit 73c52bc with merge 1d1f142...

@bors
Copy link
Collaborator

bors commented Sep 26, 2022

☀️ Test successful - checks-actions
Approved by: dingxiangfei2009
Pushing 1d1f142 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 26, 2022
@bors bors merged commit 1d1f142 into rust-lang:master Sep 26, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 26, 2022
@cjgillot cjgillot deleted the let-else-lint branch September 26, 2022 21:00
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1d1f142): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 1
Improvements ✅
(secondary)
-1.4% [-1.6%, -1.2%] 6
All ❌✅ (primary) -0.7% [-0.7%, -0.7%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.5% [4.5%, 4.5%] 1
Improvements ✅
(primary)
-3.6% [-3.6%, -3.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.6% [-3.6%, -3.6%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

7 participants