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

Remove unneeded access to pretty printer's s field in favor of deref #91571

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Dec 5, 2021

I found it taxing in some of my recent PRs touching the pretty printer to maintain consistency with the surrounding code, since the current code is all over the place about whether it uses self.s.…() or self.…() for invoking methods of rustc_ast_pretty::pp::Printer.

This PR standardizes on self.…() — relying on the Deref and DerefMut impls introduced by #62532.

@rust-highfive
Copy link
Collaborator

r? @jackh726

(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 Dec 5, 2021
@jackh726
Copy link
Member

jackh726 commented Dec 6, 2021

This isn't code that I often touch. So let's r? @Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 6, 2021

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

@dtolnay
Copy link
Member Author

dtolnay commented Dec 7, 2021

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 7, 2021

📌 Commit 1c96ef2a8d63f40da308500636b3fc01f2bd437b has been approved by Mark-Simulacrum

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

Rollup of 10 pull requests

Successful merges:

 - rust-lang#87614 (Recommend fix `count()` -> `len()` on slices)
 - rust-lang#91065 (Add test for evaluate_obligation: Ok(EvaluatedToOkModuloRegions) ICE)
 - rust-lang#91312 (Fix AnonConst ICE)
 - rust-lang#91341 (Add `array::IntoIter::{empty, from_raw_parts}`)
 - rust-lang#91493 (Remove a dead code path.)
 - rust-lang#91503 (Tweak "call this function" suggestion to have smaller span)
 - rust-lang#91547 (Suggest try_reserve in try_reserve_exact)
 - rust-lang#91562 (Pretty print async block without redundant space)
 - rust-lang#91620 (Update books)
 - rust-lang#91622 (:arrow_up: rust-analyzer)

Failed merges:

 - rust-lang#91571 (Remove unneeded access to pretty printer's `s` field in favor of deref)

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

bors commented Dec 7, 2021

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

@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 Dec 7, 2021
@dtolnay
Copy link
Member Author

dtolnay commented Dec 7, 2021

@dtolnay
Copy link
Member Author

dtolnay commented Dec 7, 2021

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 7, 2021

📌 Commit a79b702 has been approved by Mark-Simulacrum

@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 Dec 7, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 8, 2021
…crum

Remove unneeded access to pretty printer's `s` field in favor of deref

I found it taxing in some of my recent PRs touching the pretty printer to maintain consistency with the surrounding code, since the current code is all over the place about whether it uses `self.s.…()` or `self.…()` for invoking methods of `rustc_ast_pretty::pp::Printer`.

This PR standardizes on `self.…()` — relying on the `Deref` and `DerefMut` impls introduced by [rust-lang#62532](rust-lang@cab4532).
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 8, 2021
…crum

Remove unneeded access to pretty printer's `s` field in favor of deref

I found it taxing in some of my recent PRs touching the pretty printer to maintain consistency with the surrounding code, since the current code is all over the place about whether it uses `self.s.…()` or `self.…()` for invoking methods of `rustc_ast_pretty::pp::Printer`.

This PR standardizes on `self.…()` — relying on the `Deref` and `DerefMut` impls introduced by [rust-lang#62532](rust-lang@cab4532).
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 8, 2021
…crum

Remove unneeded access to pretty printer's `s` field in favor of deref

I found it taxing in some of my recent PRs touching the pretty printer to maintain consistency with the surrounding code, since the current code is all over the place about whether it uses `self.s.…()` or `self.…()` for invoking methods of `rustc_ast_pretty::pp::Printer`.

This PR standardizes on `self.…()` — relying on the `Deref` and `DerefMut` impls introduced by [rust-lang#62532](rust-lang@cab4532).
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2021
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#90709 (Only shown relevant type params in E0283 label)
 - rust-lang#91551 (Allow for failure of subst_normalize_erasing_regions in const_eval)
 - rust-lang#91570 (Evaluate inline const pat early and report error if too generic)
 - rust-lang#91571 (Remove unneeded access to pretty printer's `s` field in favor of deref)
 - rust-lang#91610 (Link to rustdoc_json_types docs instead of rustdoc-json RFC)
 - rust-lang#91619 (Update cargo)
 - rust-lang#91630 (Add missing whitespace before disabled HTML attribute)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1be98af into rust-lang:master Dec 8, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 8, 2021
@dtolnay dtolnay deleted the printerderef branch December 8, 2021 22:37
@dtolnay dtolnay added the A-pretty Area: Pretty printing (including `-Z unpretty`) label Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants