aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/trace.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2017-05-26 12:29:31 -0400
committerJosh Matthews <josh@joshmatthews.net>2017-09-25 16:10:58 -0400
commitda65698c5c5934220b82493b3f7bb2ab05a2e512 (patch)
treeebb8646bbbde4b988d55758598b6ea724149b79f /components/script/dom/bindings/trace.rs
parente481e8934a0c37a4b1eba19862ff732ec9bf19c9 (diff)
downloadservo-da65698c5c5934220b82493b3f7bb2ab05a2e512.tar.gz
servo-da65698c5c5934220b82493b3f7bb2ab05a2e512.zip
Be more conservative about safety of dictionary and union values.
Mark dictionaries containing GC values as must_root, and wrap them in RootedTraceableBox in automatically-generated APIs. To accommodate union variants that are now flagged as unsafe, add RootedTraceableBox to union variants that need to be rooted, rather than wrapping the entire union value.
Diffstat (limited to 'components/script/dom/bindings/trace.rs')
-rw-r--r--components/script/dom/bindings/trace.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index ab2b20b97c8..797ee356bd8 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -745,6 +745,7 @@ impl<'a, T: JSTraceable + 'static> Drop for RootedTraceable<'a, T> {
/// If you have GC things like *mut JSObject or JSVal, use rooted!.
/// If you have an arbitrary number of DomObjects to root, use rooted_vec!.
/// If you know what you're doing, use this.
+#[allow_unrooted_interior]
pub struct RootedTraceableBox<T: 'static + JSTraceable> {
ptr: *mut T,
}