about summary refs log tree commit diff
path: root/compiler/rustc_ast_pretty/src/pp
AgeCommit message (Collapse)AuthorLines
2025-04-28Introduce `BoxMarker` to pretty-printing.Nicholas Nethercote-8/+10
The pretty-printers open and close "boxes" of text a lot. The open and close operations must be matched. The matching is currently all implicit and very easy to get wrong. (#140280 and #140246 are two recent pretty-printing fixes that both involved unclosed boxes.) This commit introduces `BoxMarker`, a marker type that represents an open box. It makes box opening/closing explicit, which makes it much easier to understand and harder to get wrong. The commit also removes many comments are on `end` calls saying things like "end outer head-block", "Close the outer-box". These demonstrate how confusing the implicit approach was, but aren't necessary any more.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-08-16Add `warn(unreachable_pub)` to `rustc_ast_pretty`.Nicholas Nethercote-12/+12
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2023-11-22Remove or downgrade unnecessary `pub` visibility markers.Nicholas Nethercote-1/+1
2022-02-07Pretty print ItemKind::Use in rustfmt styleDavid Tolnay-0/+4
2022-02-03Change pp indent to signed to allow negative indentsDavid Tolnay-7/+4
2022-02-03Add trailing comma supportDavid Tolnay-3/+19
2022-01-31Factor convenience functions out of main printer implementationDavid Tolnay-0/+77
2022-01-19Eliminate a token clone from advance_leftDavid Tolnay-5/+6
2022-01-18Eliminate left and right cursors in favor of ring bufferDavid Tolnay-1/+19
2022-01-18Eliminate eof token stateDavid Tolnay-7/+8
2022-01-18Simplify the buffer push done by scan_breakDavid Tolnay-4/+0
2022-01-18Simplify ring buffer pushesDavid Tolnay-0/+8
2022-01-17Abstract the pretty printer's ringbuffer to be infinitely sizedDavid Tolnay-0/+53