(f: F)
| 229 | #[cfg(feature = "std")] |
| 230 | #[inline] |
| 231 | pub fn with_deferred_drops<F, R>(f: F) -> R |
| 232 | where |
| 233 | F: FnOnce() -> R, |
| 234 | { |
| 235 | let _guard = IN_DEFERRED_CONTEXT.with(|in_ctx| { |
| 236 | let was_in_context = in_ctx.get(); |
| 237 | in_ctx.set(true); |
| 238 | DeferredDropGuard { was_in_context } |
| 239 | }); |
| 240 | f() |
| 241 | } |
| 242 | |
| 243 | /// Try to defer a drop-related operation. |
| 244 | /// If inside a deferred context, the operation is queued. |
no test coverage detected