Skip to content

Commit aa7bb1c

Browse files
committed
Enable BoxMarker drop checking.
All the box open/close issues have been fixed.
1 parent 760cf8d commit aa7bb1c

File tree

1 file changed

+1
-5
lines changed
  • compiler/rustc_ast_pretty/src

1 file changed

+1
-5
lines changed

compiler/rustc_ast_pretty/src/pp.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ struct BufEntry {
244244
// forgotten will trigger a panic in `drop`. (Closing a box more than once
245245
// isn't possible because `BoxMarker` doesn't implement `Copy` or `Clone`.)
246246
//
247-
// FIXME(nnethercote): the panic in `drop` is currently disabled because a few
248-
// places fail to close their boxes. It can be enabled once they are fixed.
249-
//
250247
// Note: it would be better to make open/close mismatching impossible and avoid
251248
// the need for this marker type altogether by having functions like
252249
// `with_ibox` that open a box, call a closure, and then close the box. That
@@ -261,8 +258,7 @@ impl !Copy for BoxMarker {}
261258

262259
impl Drop for BoxMarker {
263260
fn drop(&mut self) {
264-
// FIXME(nnethercote): enable once the bad cases are fixed
265-
//panic!("BoxMarker not ended with `Printer::end()`");
261+
panic!("BoxMarker not ended with `Printer::end()`");
266262
}
267263
}
268264

0 commit comments

Comments
 (0)