diff --git a/components/style/lib.rs b/components/style/lib.rs index dae26c5b943..33e6d515994 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -14,6 +14,8 @@ #![plugin(serde_macros)] #![plugin(plugins)] +#![deny(unsafe_code)] + extern crate app_units; #[macro_use] extern crate bitflags; @@ -61,6 +63,7 @@ pub mod viewport; // Generated from the properties.mako.rs template by build.rs #[macro_use] +#[allow(unsafe_code)] pub mod properties { include!(concat!(env!("OUT_DIR"), "/properties.rs")); } diff --git a/components/style/matching.rs b/components/style/matching.rs index 3102e9bd733..3e91425cec9 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -197,6 +197,7 @@ impl StyleSharingCandidate { /// Attempts to create a style sharing candidate from this node. Returns /// the style sharing candidate or `None` if this node is ineligible for /// style sharing. + #[allow(unsafe_code)] fn new<'le, E: TElement<'le>>(element: &E) -> Option { let parent_element = match element.parent_element() { None => return None, diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs index dd99a3f26b4..8886797ad42 100644 --- a/components/style/selector_matching.rs +++ b/components/style/selector_matching.rs @@ -2,6 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// For lazy_static +#![allow(unsafe_code)] + use cssparser::{Parser, SourcePosition}; use dom::TElement; use log; diff --git a/components/style/viewport.rs b/components/style/viewport.rs index ce67a24a561..e46d22c19b1 100644 --- a/components/style/viewport.rs +++ b/components/style/viewport.rs @@ -277,6 +277,7 @@ impl ViewportRule { Ok(ViewportRule { declarations: valid_declarations.iter().cascade() }) } + #[allow(unsafe_code)] pub fn from_meta(content: &str) -> Option { let mut declarations = HashMap::new(); macro_rules! push_descriptor { @@ -458,6 +459,7 @@ impl ViewportDescriptorDeclaration { } } +#[allow(unsafe_code)] fn cascade<'a, I>(iter: I) -> Vec where I: Iterator {