Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix the implementation of JSTraceable for RefCell. #8056
Conversation
|
Regression test? |
|
This was found by inspection; I'm not sure it's actually possible to trigger this panic with Servo on master. The relevant sequence would be something like "call DOMRefCell sort of has the same issue, but the documentation for that explicitly acknowledges the problem, and it has a workaround. |
|
We've attempted to keep RefCell out of script/dom/ in the past, but never got around to actually enforcing it via a lint. |
|
|
|
|
|
Rebased. (Should this be assigned to someone?) |
|
I would rather remove all uses of RefCell (and the implementation of JSTraceable for RefCell) than add another layer of annotations for "this type doesn't contain any GC-owned values". That's the purpose of |
The implementation wasn't really right, and we would rather just use DOMRefCell anyway.
|
Okay; here's the version which just makes RefCell untraceable. |
|
@bors-servo: r+ Reviewed 11 of 11 files at r1. Comments from the review on Reviewable.io |
|
|
Fix the implementation of JSTraceable for RefCell. The existing implementation could panic; make sure that doesn't happen by requiring that the contents of a RefCell are trivially traceable (i.e. the value don't contain any traceable objects). I'm not sure whether the TriviallyJSTraceable trait is actually worthwhile; maybe we should just never use RefCell in the DOM. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8056) <!-- Reviewable:end -->
|
|
|
@bors-servo retry #7787 |
|
|
|
|
eefriedman commentedOct 17, 2015
The existing implementation could panic; make sure that doesn't
happen by requiring that the contents of a RefCell are trivially
traceable (i.e. the value don't contain any traceable objects).
I'm not sure whether the TriviallyJSTraceable trait is actually
worthwhile; maybe we should just never use RefCell in the DOM.