fix generational box
This commit is contained in:
1 parent
f54ee1c361
commit
b34418fd28
1 file changed
+3
-3
@@ -530,7 +530,7 @@ impl<S: AnyStorage> Owner<S> {
|
|||||||
/// 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.
|
/// 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<T: 'static>(&self) -> GenerationalBox<T, S> {
|
pub fn invalid<T: 'static>(&self) -> GenerationalBox<T, S> {
|
||||||
let location = S::claim();
|
let location = S::claim();
|
||||||
GenerationalBox {
|
let generational_box = GenerationalBox {
|
||||||
raw: location,
|
raw: location,
|
||||||
#[cfg(any(debug_assertions, feature = "check_generation"))]
|
#[cfg(any(debug_assertions, feature = "check_generation"))]
|
||||||
generation: location
|
generation: location
|
||||||
@@ -541,8 +541,8 @@ impl<S: AnyStorage> Owner<S> {
|
|||||||
created_at: std::panic::Location::caller(),
|
created_at: std::panic::Location::caller(),
|
||||||
_marker: PhantomData,
|
_marker: PhantomData,
|
||||||
};
|
};
|
||||||
self.owned.borrow_mut().push(location);
|
self.owned.lock().push(location);
|
||||||
key
|
generational_box
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user