Remove fake BoxMarkers.

They don't appear to do anything -- no test output is affected -- and no
other pretty-printing code looks like this.
This commit is contained in:
Nicholas Nethercote
2025-04-29 16:52:17 +10:00
parent 4824c2bb74
commit 882c74dfcf
2 changed files with 1 additions and 19 deletions

View File

@@ -13,7 +13,7 @@ use rustc_ast::{
use crate::pp::Breaks::Inconsistent;
use crate::pprust::state::fixup::FixupContext;
use crate::pprust::state::{AnnNode, BoxMarker, INDENT_UNIT, PrintState, State};
use crate::pprust::state::{AnnNode, INDENT_UNIT, PrintState, State};
impl<'a> State<'a> {
fn print_else(&mut self, els: Option<&ast::Expr>) {
@@ -542,15 +542,6 @@ impl<'a> State<'a> {
self.print_fn_params_and_ret(fn_decl, true);
self.space();
self.print_expr(body, FixupContext::default());
// FIXME(nnethercote): Bogus. Reduce visibility of `ended` once it's fixed.
let fake_ib = BoxMarker;
self.end(fake_ib);
// A box will be closed by print_expr, but we didn't want an overall
// wrapper so we closed the corresponding opening. so create an
// empty box to satisfy the close.
// FIXME(nnethercote): Bogus.
let _ib = self.ibox(0);
}
ast::ExprKind::Block(blk, opt_label) => {
if let Some(label) = opt_label {