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

Tweak borrow suggestion span #110504

Merged
merged 3 commits into from
May 9, 2023
Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Apr 18, 2023

Avoids a span_to_snippet call when we don't need to surround the expression in parentheses. The fact that the suggestion was using the whole span of the expression rather than just appending a & was prevented me from using // run-rustfix in another PR (#110432 (comment)).

Also some drive-by renames of functions that have been annoying me for a bit.

@rustbot
Copy link
Collaborator

rustbot commented Apr 18, 2023

r? @cjgillot

(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 Apr 18, 2023
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor

Could you completely remove the span_to_snippet call by making the suggestion multipart?

@compiler-errors
Copy link
Member Author

I could, but that would require a bit more work, since this function currently has a very strange API:

-> Option<(
        Span,
        String,
        String,
        Applicability,
        bool, /* verbose */
        bool, /* suggest `&` or `&mut` type annotation */
    )> {

I guess I'll look into it.

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 28, 2023

📌 Commit cf24419 has been approved by cjgillot

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 28, 2023

🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened.

@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 Apr 28, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 29, 2023
… r=cjgillot

Tweak borrow suggestion span

Avoids a `span_to_snippet` call when we don't need to surround the expression in parentheses. The fact that the suggestion was using the whole span of the expression rather than just appending a `&` was prevented me from using `// run-rustfix` in another PR (rust-lang#110432 (comment)).

Also some drive-by renames of functions that have been annoying me for a bit.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 29, 2023
… r=cjgillot

Tweak borrow suggestion span

Avoids a `span_to_snippet` call when we don't need to surround the expression in parentheses. The fact that the suggestion was using the whole span of the expression rather than just appending a `&` was prevented me from using `// run-rustfix` in another PR (rust-lang#110432 (comment)).

Also some drive-by renames of functions that have been annoying me for a bit.
@matthiaskrgr
Copy link
Member

@bors r- needs rebase I guess
#110993 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 29, 2023
@compiler-errors
Copy link
Member Author

rebased

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented May 1, 2023

📌 Commit f0e7af4 has been approved by cjgillot

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 1, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 1, 2023
… r=cjgillot

Tweak borrow suggestion span

Avoids a `span_to_snippet` call when we don't need to surround the expression in parentheses. The fact that the suggestion was using the whole span of the expression rather than just appending a `&` was prevented me from using `// run-rustfix` in another PR (rust-lang#110432 (comment)).

Also some drive-by renames of functions that have been annoying me for a bit.
@bors
Copy link
Contributor

bors commented May 3, 2023

☔ The latest upstream changes (presumably #110579) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 3, 2023
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 3, 2023
We really shouldn't be naming functions `fn check_*` unless they're
doing *typechecking*. It's especially misleading when we're doing this
inside of HIR typeck.
@compiler-errors
Copy link
Member Author

rebased again

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented May 8, 2023

📌 Commit 4731a25 has been approved by cjgillot

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 8, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2023
Rollup of 7 pull requests

Successful merges:

 - rust-lang#110304 (Add GNU Property Note)
 - rust-lang#110504 (Tweak borrow suggestion span)
 - rust-lang#110583 (tweak "make mut" spans when assigning to locals)
 - rust-lang#110694 (Implement builtin # syntax and use it for offset_of!(...))
 - rust-lang#111120 (Suggest let for possible binding with ty)
 - rust-lang#111252 (Min specialization improvements)
 - rust-lang#111361 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2ecc722 into rust-lang:master May 9, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 9, 2023
@compiler-errors compiler-errors deleted the tweak-borrow-sugg branch August 11, 2023 20:21
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