Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
dtolnay:printerderef
Dec 8, 2021
Merged

Remove unneeded access to pretty printer's s field in favor of deref#91571
bors merged 1 commit into
rust-lang:masterfrom
dtolnay:printerderef

Conversation

@dtolnay

@dtolnay dtolnay commented Dec 5, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

jackh726 commented Dec 6, 2021

Copy link
Copy Markdown
Member

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

@bors

bors commented Dec 6, 2021

Copy link
Copy Markdown
Collaborator

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

@dtolnay

dtolnay commented Dec 7, 2021

Copy link
Copy Markdown
Member Author

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Dec 7, 2021

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Dec 7, 2021

Copy link
Copy Markdown
Collaborator

☔ 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

dtolnay commented Dec 7, 2021

Copy link
Copy Markdown
Member Author

@dtolnay

dtolnay commented Dec 7, 2021

Copy link
Copy Markdown
Member Author

@bors r=Mark-Simulacrum

@bors

bors commented Dec 7, 2021

Copy link
Copy Markdown
Collaborator

📌 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
@dtolnay dtolnay added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 14, 2025
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`) 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