-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Give a name to each distinct manipulation of pretty-printer FixupContext #124191
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 20, 2024
Required for being able to make the fields private and force the use of accessor methods, which will be added in the next commit.
compiler-errors
approved these changes
Apr 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed docs.
r? compiler-errors @bors r+ rollup |
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 20, 2024
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
Apr 20, 2024
Give a name to each distinct manipulation of pretty-printer FixupContext There are only 7 distinct ways that the AST pretty-printer interacts with FixupContext: 3 constructors (including Default), 2 transformations, and 2 queries. This PR turns these into associated functions which can be documented with examples. This PR unblocks rust-lang#119427 (comment). In order to improve the pretty-printer's behavior regarding parenthesization of braced macro calls in match arms, which have different grammar than macro calls in statements, FixupContext needs to be extended with 2 new fields. In the previous approach, that would be onerous. In the new approach, all it entails is 1 new constructor (`FixupContext::new_match_arm()`).
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 20, 2024
Rollup of 11 pull requests Successful merges: - rust-lang#123379 (Print note with closure signature on type mismatch) - rust-lang#123967 (static_mut_refs: use raw pointers to remove the remaining FIXME) - rust-lang#123976 (Use fake libc in core test) - rust-lang#123986 (lint-docs: Add redirects for renamed lints.) - rust-lang#124053 (coverage: Branch coverage tests for lazy boolean operators) - rust-lang#124071 (Add llvm-bitcode-linker to build manifest) - rust-lang#124103 (Improve std::fs::Metadata Debug representation) - rust-lang#124132 (llvm RustWrapper: explain OpBundlesIndirect argument type) - rust-lang#124191 (Give a name to each distinct manipulation of pretty-printer FixupContext) - rust-lang#124193 (Miri subtree update) - rust-lang#124196 (mir-opt tests: rename unit-test -> test-mir-pass) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 20, 2024
Rollup of 10 pull requests Successful merges: - rust-lang#123379 (Print note with closure signature on type mismatch) - rust-lang#123967 (static_mut_refs: use raw pointers to remove the remaining FIXME) - rust-lang#123976 (Use fake libc in core test) - rust-lang#123986 (lint-docs: Add redirects for renamed lints.) - rust-lang#124053 (coverage: Branch coverage tests for lazy boolean operators) - rust-lang#124071 (Add llvm-bitcode-linker to build manifest) - rust-lang#124103 (Improve std::fs::Metadata Debug representation) - rust-lang#124132 (llvm RustWrapper: explain OpBundlesIndirect argument type) - rust-lang#124191 (Give a name to each distinct manipulation of pretty-printer FixupContext) - rust-lang#124196 (mir-opt tests: rename unit-test -> test-mir-pass) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 21, 2024
Rollup merge of rust-lang#124191 - dtolnay:fixup, r=compiler-errors Give a name to each distinct manipulation of pretty-printer FixupContext There are only 7 distinct ways that the AST pretty-printer interacts with FixupContext: 3 constructors (including Default), 2 transformations, and 2 queries. This PR turns these into associated functions which can be documented with examples. This PR unblocks rust-lang#119427 (comment). In order to improve the pretty-printer's behavior regarding parenthesization of braced macro calls in match arms, which have different grammar than macro calls in statements, FixupContext needs to be extended with 2 new fields. In the previous approach, that would be onerous. In the new approach, all it entails is 1 new constructor (`FixupContext::new_match_arm()`).
This was referenced May 12, 2024
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.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are only 7 distinct ways that the AST pretty-printer interacts with FixupContext: 3 constructors (including Default), 2 transformations, and 2 queries.
This PR turns these into associated functions which can be documented with examples.
This PR unblocks #119427 (comment). In order to improve the pretty-printer's behavior regarding parenthesization of braced macro calls in match arms, which have different grammar than macro calls in statements, FixupContext needs to be extended with 2 new fields. In the previous approach, that would be onerous. In the new approach, all it entails is 1 new constructor (
FixupContext::new_match_arm()
).