Skip to content

Commit 882c74d

Browse files
committed
Remove fake BoxMarkers.
They don't appear to do anything -- no test output is affected -- and no other pretty-printing code looks like this.
1 parent 4824c2b commit 882c74d

File tree

2 files changed

+1
-19
lines changed
  • compiler
    • rustc_ast_pretty/src/pprust/state
    • rustc_hir_pretty/src

2 files changed

+1
-19
lines changed

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_ast::{
1313

1414
use crate::pp::Breaks::Inconsistent;
1515
use crate::pprust::state::fixup::FixupContext;
16-
use crate::pprust::state::{AnnNode, BoxMarker, INDENT_UNIT, PrintState, State};
16+
use crate::pprust::state::{AnnNode, INDENT_UNIT, PrintState, State};
1717

1818
impl<'a> State<'a> {
1919
fn print_else(&mut self, els: Option<&ast::Expr>) {
@@ -542,15 +542,6 @@ impl<'a> State<'a> {
542542
self.print_fn_params_and_ret(fn_decl, true);
543543
self.space();
544544
self.print_expr(body, FixupContext::default());
545-
// FIXME(nnethercote): Bogus. Reduce visibility of `ended` once it's fixed.
546-
let fake_ib = BoxMarker;
547-
self.end(fake_ib);
548-
549-
// A box will be closed by print_expr, but we didn't want an overall
550-
// wrapper so we closed the corresponding opening. so create an
551-
// empty box to satisfy the close.
552-
// FIXME(nnethercote): Bogus.
553-
let _ib = self.ibox(0);
554545
}
555546
ast::ExprKind::Block(blk, opt_label) => {
556547
if let Some(label) = opt_label {

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,15 +1572,6 @@ impl<'a> State<'a> {
15721572

15731573
// This is a bare expression.
15741574
self.ann.nested(self, Nested::Body(body));
1575-
// FIXME(nnethercote): this is bogus
1576-
let fake_ib = BoxMarker;
1577-
self.end(fake_ib);
1578-
1579-
// A box will be closed by `print_expr`, but we didn't want an overall
1580-
// wrapper so we closed the corresponding opening. so create an
1581-
// empty box to satisfy the close.
1582-
// FIXME(nnethercote): this is bogus, and `print_expr` is missing
1583-
let _ib = self.ibox(0);
15841575
}
15851576
hir::ExprKind::Block(blk, opt_label) => {
15861577
if let Some(label) = opt_label {

0 commit comments

Comments
 (0)