diff --git a/components/malloc_size_of/lib.rs b/components/malloc_size_of/lib.rs index 3801669ab5d..5e97a2709dc 100644 --- a/components/malloc_size_of/lib.rs +++ b/components/malloc_size_of/lib.rs @@ -58,9 +58,9 @@ extern crate smallvec; extern crate string_cache; #[cfg(feature = "url")] extern crate url; +extern crate void; #[cfg(feature = "webrender_api")] extern crate webrender_api; -extern crate void; #[cfg(feature = "servo")] extern crate xml5ever; diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 703b6be9fe5..a5f1abd935e 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -364,7 +364,8 @@ pub enum AnimationValue { impl AnimationValue { /// Returns the longhand id this animated value corresponds to. pub fn id(&self) -> LonghandId { - match *self { + let id = unsafe { *(self as *const _ as *const LonghandId) }; + debug_assert_eq!(id, match *self { % for prop in data.longhands: % if prop.animatable: AnimationValue::${prop.camel_case}(..) => LonghandId::${prop.camel_case}, @@ -372,7 +373,8 @@ impl AnimationValue { AnimationValue::${prop.camel_case}(void) => void::unreachable(void), % endif % endfor - } + }); + id } /// "Uncompute" this animation value in order to be used inside the CSS