about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-04-25 08:29:49 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-04-28 15:51:25 +1000
commitaff1be2637cecd0ef4224570b9ddf23f62f88b2b (patch)
tree72f3cc5d9faaaa91656843e3a15afddb3201ec04 /compiler/rustc_codegen_llvm
parentcb31a009e3e735ab08613cec2d8a5a754e65596f (diff)
downloadrust-aff1be2637cecd0ef4224570b9ddf23f62f88b2b.tar.gz
rust-aff1be2637cecd0ef4224570b9ddf23f62f88b2b.zip
Introduce `BoxMarker` to pretty-printing.
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm')
0 files changed, 0 insertions, 0 deletions