diff --git a/packages/generational-box/src/lib.rs b/packages/generational-box/src/lib.rs index fc91b8bd9..8009a1e9e 100644 --- a/packages/generational-box/src/lib.rs +++ b/packages/generational-box/src/lib.rs @@ -530,7 +530,7 @@ impl Owner { /// Creates an invalid handle. This is useful for creating a handle that will be filled in later. If you use this before the value is filled in, you will get may get a panic or an out of date value. pub fn invalid(&self) -> GenerationalBox { let location = S::claim(); - GenerationalBox { + let generational_box = GenerationalBox { raw: location, #[cfg(any(debug_assertions, feature = "check_generation"))] generation: location @@ -541,8 +541,8 @@ impl Owner { created_at: std::panic::Location::caller(), _marker: PhantomData, }; - self.owned.borrow_mut().push(location); - key + self.owned.lock().push(location); + generational_box } }