diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-26 18:52:08 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-31 09:34:36 +0000 |
| commit | 375d8f1b25b12d252e6aff030c0bcf64b77f886b (patch) | |
| tree | b7a4130061afd47dd42d4b619b16207be5d04b76 | |
| parent | d9deaf4b8af7efc4b980e00e2f15622c20d9cdc3 (diff) | |
| download | rust-375d8f1b25b12d252e6aff030c0bcf64b77f886b.tar.gz rust-375d8f1b25b12d252e6aff030c0bcf64b77f886b.zip | |
Sanity check that we actually flush all buffers
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 0d73073395b..0cae06881b1 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -2617,6 +2617,15 @@ impl Write for Buffy { } } +impl Drop for Buffy { + fn drop(&mut self) { + if !self.buffer.is_empty() { + self.flush().unwrap(); + panic!("buffers need to be flushed in order to print their contents"); + } + } +} + impl WriteColor for Buffy { fn supports_color(&self) -> bool { self.buffer.supports_color() |
