INNER CODE UNIT · Rust

drop_notifier_drops_inner_before_notify

pamburus/hl · crates/lifecycle/src/lib.rs:96

    fn drop_notifier_drops_inner_before_notify() {
        let order = Arc::new(Mutex::new(Vec::new()));
        let order_clone = Arc::clone(&order);

        struct TestDrop {
            order: Arc<Mutex<Vec<u8>>>,
        }

        impl Drop for TestDrop {
            fn drop(&mut self) {
                self.order.lock().unwrap().push(1);
            }
        }

        {
            let test_drop = TestDrop {
                order: Arc::clone(&order),
            };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…