Skip to content

MutableHandle are clonable breaking safety provided by &mut #520

Closed
servo/servo
#35892
@sagudev

Description

@sagudev

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 servo/servo#34087 (comment)

When cloning MutableHandle we still have underlying pointer point to same location, so we can have two &mut that points to same location.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions