Skip to content

Tighten the 'introduce new binding' suggestion - #104186

Merged
bors merged 3 commits into
rust-lang:masterfrom
chenyukang:yukang/fix-104086-let-binding-issue
Nov 10, 2022
Merged

Tighten the 'introduce new binding' suggestion#104186
bors merged 3 commits into
rust-lang:masterfrom
chenyukang:yukang/fix-104086-let-binding-issue

Conversation

@chenyukang

Copy link
Copy Markdown
Member

Fixes#104086

@rustbot

Copy link
Copy Markdown
Collaborator

r? @oli-obk

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

@rustbotrustbot 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 Nov 9, 2022
@chenyukang
chenyukangforce-pushed the yukang/fix-104086-let-binding-issue branch from 74d112d to 952df48CompareNovember 9, 2022 10:09
Comment threadsrc/test/ui/suggestions/issue-104086-suggest-let.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
@chenyukang
chenyukangforce-pushed the yukang/fix-104086-let-binding-issue branch from 1bd6af1 to 07381b3CompareNovember 9, 2022 15:48
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
@chenyukang
chenyukangforce-pushed the yukang/fix-104086-let-binding-issue branch from 07381b3 to c69872bCompareNovember 10, 2022 03:05
@oli-obk

Copy link
Copy Markdown
Contributor

Thanks!

@bors r+ rollup

@bors

bors commented Nov 10, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit c69872b has been approved by oli-obk

It is now in the queue for this repository.

@borsbors 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 Nov 10, 2022
}
self.visit_expr(lhs);
self.diagnostic_metadata.is_assign_rhs = true;
self.diagnostic_metadata.in_assignment = None;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we reinstate the overwritten value, instead of putting None in all cases?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

we only care about the lhs of assignment.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

And the backup state is not important, the check logic is invoked by visit_expr.

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 10, 2022
…earth
Rollup of 9 pull requests
Successful merges:
- rust-lang#101939 (Add loongarch64 abi support)
- rust-lang#103863 (Use `TraitEngine` in more places, restrict visibility of `FulfillmentCtxt` constructor)
- rust-lang#104036 (Suggest `is_some` when we've found `Option` but expected `bool`)
- rust-lang#104060 (Make `Hash`, `Hasher` and `BuildHasher` `#[const_trait]` and make `Sip` const `Hasher`)
- rust-lang#104077 (Use aapcs for efiapi calling convention on arm)
- rust-lang#104186 (Tighten the 'introduce new binding' suggestion)
- rust-lang#104194 (`EarlyBinder` docs)
- rust-lang#104233 (Don't ICE when encountering `ConstKind::Error` in `RequiredConstsVisitor`)
- rust-lang#104235 (Use `const_error_with_guaranteed` more)
Failed merges:
- rust-lang#104078 (Print "Checking/Building ..." message even when --dry-run is passed)
- rust-lang#104169 (Migrate `:target` rules to use CSS variables)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 819c931 into rust-lang:masterNov 10, 2022
@rustbotrustbot added this to the 1.67.0 milestone Nov 10, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

Tighten "introduce new binding" suggestion

5 participants

@chenyukang@rustbot@oli-obk@bors@cjgillot