diff options
Diffstat (limited to 'components/servo_arc/lib.rs')
-rw-r--r-- | components/servo_arc/lib.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs index 0040fdea6d1..ff4074767f8 100644 --- a/components/servo_arc/lib.rs +++ b/components/servo_arc/lib.rs @@ -22,14 +22,16 @@ // duplicate those here. #![allow(missing_docs)] -#[cfg(feature = "servo")] extern crate serde; extern crate nodrop; +#[cfg(feature = "servo")] extern crate serde; +extern crate stable_deref_trait; #[cfg(feature = "servo")] use heapsize::HeapSizeOf; use nodrop::NoDrop; #[cfg(feature = "servo")] use serde::{Deserialize, Serialize}; +use stable_deref_trait::{CloneStableDeref, StableDeref}; use std::{isize, usize}; use std::borrow; use std::cmp::Ordering; @@ -432,6 +434,9 @@ impl<T: ?Sized> AsRef<T> for Arc<T> { } } +unsafe impl<T: ?Sized> StableDeref for Arc<T> {} +unsafe impl<T: ?Sized> CloneStableDeref for Arc<T> {} + // This is what the HeapSize crate does for regular arc, but is questionably // sound. See https://github.com/servo/heapsize/issues/37 #[cfg(feature = "servo")] |