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

Shrink span for bindings with subpatterns. #101399

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Sep 3, 2022

Bindings with nested patterns (binding @ pat syntax) currently point to the full pattern. This PR proposes to shrink the span to stop before the @. This makes the diagnostics for move/mutability conflicts clearer, as they not point to the binding only, instead of the full pat.

r? @estebank

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 3, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2022
@rust-log-analyzer

This comment has been minimized.

@estebank
Copy link
Contributor

estebank commented Sep 6, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Sep 6, 2022

📌 Commit 5d94d42 has been approved by estebank

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 6, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 7, 2022
…estebank

Shrink span for bindings with subpatterns.

Bindings with nested patterns (`binding @ pat` syntax) currently point to the full pattern.  This PR proposes to shrink the span to stop before the ```@`.``  This makes the diagnostics for move/mutability conflicts clearer, as they not point to the `binding` only, instead of the full pat.

r? ``@estebank``
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 8, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#101153 (Migrate another part of rustc_infer to session diagnostic)
 - rust-lang#101399 (Shrink span for bindings with subpatterns.)
 - rust-lang#101422 (Hermit: Add File::set_time stub)
 - rust-lang#101455 (Avoid UB in the Windows filesystem code in... bootstrap?)
 - rust-lang#101498 (rustc: Parameterize `ty::Visibility` over used ID)
 - rust-lang#101549 (Use HashStable_Generic in rustc_type_ir)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0d61a50 into rust-lang:master Sep 8, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 8, 2022
@cjgillot cjgillot deleted the borrowck-binding-span branch September 8, 2022 10:31
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.

6 participants