Lines Matching refs:guard
253 let _guard = $crate::guard((), |()| { $($t)* });
348 pub fn into_inner(guard: Self) -> T { in into_inner()
352 let value = ptr::read(&*guard.value); in into_inner()
357 let _dropfn = ptr::read(&*guard.dropfn); in into_inner()
358 mem::forget(guard); in into_inner()
367 pub fn guard<T, F>(v: T, dropfn: F) -> ScopeGuard<T, F, Always> in guard() function
537 let value = guard((), |()| value_drops.set(1 + value_drops.get())); in test_only_dropped_by_closure_when_run()
539 let guard = guard(value, |_| closure_drops.set(1 + closure_drops.get())); in test_only_dropped_by_closure_when_run() localVariable
542 drop(guard); in test_only_dropped_by_closure_when_run()
551 let value = guard((), |()| value_drops.set(1 + value_drops.get())); in test_dropped_once_when_not_run()
553 let captured = guard((), |()| captured_drops.set(1 + captured_drops.get())); in test_dropped_once_when_not_run()
555 let guard = guard_on_unwind(value, |value| { in test_dropped_once_when_not_run() localVariable
563 drop(guard); in test_dropped_once_when_not_run()
572 let value = guard(42, |_| dropped.set(true)); in test_into_inner()
573 let guard = guard(value, |_| dropped.set(true)); in test_into_inner() localVariable
574 let inner = ScopeGuard::into_inner(guard); in test_into_inner()