Open sagudev opened 4 weeks ago
I think the proper solution would be to not impl Clone/Copy for *Handle or at least mark it as unsafe.
I think the first action point would be to remove all mozjs::rust::wrappers
usages, then we can remove clone,copy in followup.
mut is required for https://doc.servo.org/mozjs/gc/root/struct.MutableHandle.html#tymethod.set, but this is still weird as MutableHandle is clonable so
&mut
does not help a lot with safety._Originally posted by @sagudev in https://github.com/servo/servo/pull/34087#discussion_r1825494608_
When cloning MutableHandle we still have underlying pointer point to same location, so we can have two &mut that points to same location.