diff --git a/components/style/viewport.rs b/components/style/viewport.rs index bbdd3a2ed35..2e965da4e54 100644 --- a/components/style/viewport.rs +++ b/components/style/viewport.rs @@ -69,7 +69,7 @@ macro_rules! declare_viewport_descriptor_inner { const VIEWPORT_DESCRIPTOR_VARIANTS: usize = $number_of_variants; impl ViewportDescriptor { - fn discriminant_value(&self) -> usize { + pub fn discriminant_value(&self) -> usize { match *self { $( ViewportDescriptor::$assigned_variant(..) => $assigned_discriminant, diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index e2c2bbe7e28..f2be3da2307 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #![cfg(test)] -#![feature(core_intrinsics, plugin, test)] +#![feature(plugin, test)] extern crate app_units; extern crate cssparser; diff --git a/tests/unit/style/viewport.rs b/tests/unit/style/viewport.rs index 2ca9733afc2..026269421f7 100644 --- a/tests/unit/style/viewport.rs +++ b/tests/unit/style/viewport.rs @@ -51,13 +51,11 @@ fn test_meta_viewport(meta: &str, callback: F) where F: Fn(&Vec, &str) { if let Some(mut rule) = ViewportRule::from_meta(meta) { - use std::intrinsics::discriminant_value; - // from_meta uses a hash-map to collect the declarations, so we need to // sort them in a stable order for the tests rule.declarations.sort_by(|a, b| { - let a = unsafe { discriminant_value(&a.descriptor) }; - let b = unsafe { discriminant_value(&b.descriptor) }; + let a = a.descriptor.discriminant_value(); + let b = b.descriptor.discriminant_value(); a.cmp(&b) });