Skip to content

Truly independent web browser

LibJS: Say that a GcWeak holds no Gc

Shannon Boothfa093c9b0c89
diff --git a/Libraries/LibJS/Rust/src/gc/weak.rs b/Libraries/LibJS/Rust/src/gc/weak.rs
index e3425660a62..b859f69a1ab 100644
--- a/Libraries/LibJS/Rust/src/gc/weak.rs
+++ b/Libraries/LibJS/Rust/src/gc/weak.rs
@@ -19,7 +19,8 @@ pub(super) const WEAK_IMPL_POINTER_OFFSET: usize = 16;
/// A reference to a cell that does not keep it alive.
pub struct GcWeak<T> {
weak_impl: NonNull<GCWeakImpl>,
- _cell: PhantomData<Gc<T>>,
+ // NB: A GcWeak gives a Gc<T> out, but holds none.
+ _cell: PhantomData<fn() -> Gc<T>>,
}
impl<T> GcWeak<T> {