diff --git a/mozjs/src/gc/collections.rs b/mozjs/src/gc/collections.rs index 28dd76867fd..cbefa4621ee 100644 --- a/mozjs/src/gc/collections.rs +++ b/mozjs/src/gc/collections.rs @@ -125,7 +125,7 @@ where Heap: Traceable + 'static, T: GCMethods + Copy, { - pub fn handle(&self) -> Handle { + pub fn handle(&'_ self) -> Handle<'_, T> { unsafe { Handle::from_raw((*self.ptr).handle()) } } } diff --git a/mozjs/src/gc/custom.rs b/mozjs/src/gc/custom.rs index 2f36b21393b..56e00966669 100644 --- a/mozjs/src/gc/custom.rs +++ b/mozjs/src/gc/custom.rs @@ -106,7 +106,7 @@ impl CustomAutoRooter { } } - pub fn root(&mut self, cx: *mut JSContext) -> CustomAutoRooterGuard { + pub fn root(&'_ mut self, cx: *mut JSContext) -> CustomAutoRooterGuard<'_, T> { CustomAutoRooterGuard::new(cx, self) } } @@ -140,7 +140,7 @@ impl<'a, T: 'a + CustomTrace> CustomAutoRooterGuard<'a, T> { Handle::new(&self.rooter.data) } - pub fn handle_mut(&mut self) -> MutableHandle + pub fn handle_mut(&'a mut self) -> MutableHandle<'a, T> where T: RootKind, { diff --git a/mozjs/src/gc/root.rs b/mozjs/src/gc/root.rs index d9ee964b33f..32a963f4ff0 100644 --- a/mozjs/src/gc/root.rs +++ b/mozjs/src/gc/root.rs @@ -42,7 +42,7 @@ impl<'a, T: 'a + RootKind> RootedGuard<'a, T> { Handle::new(&self) } - pub fn handle_mut(&mut self) -> MutableHandle { + pub fn handle_mut(&'a mut self) -> MutableHandle<'a, T> { unsafe { MutableHandle::from_marked_location(self.as_ptr()) } } @@ -206,7 +206,7 @@ impl<'a, T> MutableHandle<'a, T> { MutableHandle::from_marked_location(handle.ptr) } - pub fn handle(&self) -> Handle { + pub fn handle(&'a self) -> Handle<'a, T> { unsafe { Handle::new(&*self.ptr) } }