mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-01 05:25:38 +00:00
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.
12 lines
227 B
Rust
12 lines
227 B
Rust
// tidy-alphabetical-start
|
|
#![allow(internal_features)]
|
|
#![doc(rust_logo)]
|
|
#![feature(box_patterns)]
|
|
#![feature(negative_impls)]
|
|
#![feature(rustdoc_internals)]
|
|
// tidy-alphabetical-end
|
|
|
|
mod helpers;
|
|
pub mod pp;
|
|
pub mod pprust;
|