about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-04-29 20:17:29 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-05-03 09:14:27 +1000
commitaa7bb1c2f5a8d8e8b709421189186e8e5e8b64f9 (patch)
treea9d0dcde8e61c8faf147454a024ae1e916906c98
parent760cf8d3afd446e9a5f3dc1af006548a0da5686c (diff)
downloadrust-aa7bb1c2f5a8d8e8b709421189186e8e5e8b64f9.tar.gz
rust-aa7bb1c2f5a8d8e8b709421189186e8e5e8b64f9.zip
Enable `BoxMarker` drop checking.
All the box open/close issues have been fixed.
-rw-r--r--compiler/rustc_ast_pretty/src/pp.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs
index 142c80b8e39..8a0dbadf18c 100644
--- a/compiler/rustc_ast_pretty/src/pp.rs
+++ b/compiler/rustc_ast_pretty/src/pp.rs
@@ -244,9 +244,6 @@ struct BufEntry {
 // forgotten will trigger a panic in `drop`. (Closing a box more than once
 // isn't possible because `BoxMarker` doesn't implement `Copy` or `Clone`.)
 //
-// FIXME(nnethercote): the panic in `drop` is currently disabled because a few
-// places fail to close their boxes. It can be enabled once they are fixed.
-//
 // Note: it would be better to make open/close mismatching impossible and avoid
 // the need for this marker type altogether by having functions like
 // `with_ibox` that open a box, call a closure, and then close the box. That
@@ -261,8 +258,7 @@ impl !Copy for BoxMarker {}
 
 impl Drop for BoxMarker {
     fn drop(&mut self) {
-        // FIXME(nnethercote): enable once the bad cases are fixed
-        //panic!("BoxMarker not ended with `Printer::end()`");
+        panic!("BoxMarker not ended with `Printer::end()`");
     }
 }