diff --git a/src/collections/scoped_buffer.rs b/src/collections/scoped_buffer.rs index da789984728f3c4796ea46d3715fc91395ab10fd..956d77b87b9fd6351d77e29b7bf54454b59683c0 100644 --- a/src/collections/scoped_buffer.rs +++ b/src/collections/scoped_buffer.rs @@ -176,7 +176,10 @@ impl std::ops::IndexMut for ScopedSection { } } -#[cfg(debug_assertions)] +// note: this `Drop` impl used to be debug-only, requiring the programmer to +// call `into_vec` or `forget`. But this is rather error prone. So we'll check +// in debug mode, but always truncate in release mode (even though this is a +// noop in most cases). impl Drop for ScopedSection { fn drop(&mut self) { let vec = unsafe{&mut *self.inner};