MCPcopy Index your code
hub / github.com/RustPython/RustPython / drop

Method drop

crates/common/src/refcount.rs:214–223  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

212#[cfg(feature = "std")]
213impl Drop for DeferredDropGuard {
214 fn drop(&mut self) {
215 IN_DEFERRED_CONTEXT.with(|in_ctx| {
216 in_ctx.set(self.was_in_context);
217 });
218 // Only flush if we're the outermost context and not already panicking
219 // (flushing during unwinding risks double-panic → process abort).
220 if !self.was_in_context && !std::thread::panicking() {
221 flush_deferred_drops();
222 }
223 }
224}
225
226/// Execute a function within a deferred drop context.

Callers

nothing calls this directly

Calls 3

flush_deferred_dropsFunction · 0.85
withMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected