Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mozjs/src/gc/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ where
Heap<T>: Traceable + 'static,
T: GCMethods + Copy,
{
pub fn handle(&self) -> Handle<T> {
pub fn handle(&'_ self) -> Handle<'_, T> {
unsafe { Handle::from_raw((*self.ptr).handle()) }
}
}
Expand Down
4 changes: 2 additions & 2 deletions mozjs/src/gc/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl<T: CustomTrace> CustomAutoRooter<T> {
}
}

pub fn root(&mut self, cx: *mut JSContext) -> CustomAutoRooterGuard<T> {
pub fn root(&'_ mut self, cx: *mut JSContext) -> CustomAutoRooterGuard<'_, T> {
CustomAutoRooterGuard::new(cx, self)
}
}
Expand Down Expand Up @@ -140,7 +140,7 @@ impl<'a, T: 'a + CustomTrace> CustomAutoRooterGuard<'a, T> {
Handle::new(&self.rooter.data)
}

pub fn handle_mut(&mut self) -> MutableHandle<T>
pub fn handle_mut(&'a mut self) -> MutableHandle<'a, T>
where
T: RootKind,
{
Expand Down
4 changes: 2 additions & 2 deletions mozjs/src/gc/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<'a, T: 'a + RootKind> RootedGuard<'a, T> {
Handle::new(&self)
}

pub fn handle_mut(&mut self) -> MutableHandle<T> {
pub fn handle_mut(&'a mut self) -> MutableHandle<'a, T> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this seems to cause borrow-checker errors. The lifetime 'ashould be correct, given that handle() also uses it?
I don't have time to look deeper into this today though.

unsafe { MutableHandle::from_marked_location(self.as_ptr()) }
}

Expand Down Expand Up @@ -206,7 +206,7 @@ impl<'a, T> MutableHandle<'a, T> {
MutableHandle::from_marked_location(handle.ptr)
}

pub fn handle(&self) -> Handle<T> {
pub fn handle(&'a self) -> Handle<'a, T> {
unsafe { Handle::new(&*self.ptr) }
}

Expand Down
Loading