Repository navigation
Fix 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. |
|
☔ The latest upstream changes (presumably #8041) made this pull request unmergeable. Please resolve the merge conflicts. |
0247dc4 to
643127b
Compare
|
☔ The latest upstream changes (presumably #8091) made this pull request unmergeable. Please resolve the merge conflicts. |
643127b to
6486dd6
Compare
|
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.
6486dd6 to
df7fb8f
Compare
|
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 |
|
📌 Commit df7fb8f has been approved by |
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 -->
|
💔 Test failed - linux-rel |
|
@bors-servo retry #7787 |
|
⚡ Previous build results for android, gonk, linux-dev, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt are reusable. Rebuilding only linux-rel... |
|
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt |
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.