From 38ed3a46d68fe6be7a8723371c19a462d83ef19e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 12 Aug 2015 13:16:31 +0200 Subject: [PATCH] Disallow unsafe code in the devtools and devtools_traits crates. --- components/devtools/actor.rs | 2 ++ components/devtools/lib.rs | 1 + components/devtools_traits/lib.rs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs index a2499ec467b..b0cd26e2468 100644 --- a/components/devtools/actor.rs +++ b/components/devtools/actor.rs @@ -44,6 +44,7 @@ impl Actor + Send { /// Returns some reference to the boxed value if it is of type `T`, or /// `None` if it isn't. #[inline] + #[allow(unsafe_code)] pub fn downcast_ref(&self) -> Option<&T> { if self.is::() { unsafe { @@ -61,6 +62,7 @@ impl Actor + Send { /// Returns some mutable reference to the boxed value if it is of type `T`, or /// `None` if it isn't. #[inline] + #[allow(unsafe_code)] pub fn downcast_mut(&mut self) -> Option<&mut T> { if self.is::() { unsafe { diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs index d9335943b1e..046a6dbddc1 100644 --- a/components/devtools/lib.rs +++ b/components/devtools/lib.rs @@ -20,6 +20,7 @@ #![plugin(serde_macros)] #![allow(non_snake_case)] +#![deny(unsafe_code)] #[macro_use] extern crate log; diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index 65bbd238dd1..2013ec79c96 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -10,6 +10,8 @@ #![crate_type = "rlib"] #![allow(non_snake_case)] +#![deny(unsafe_code)] + #![feature(custom_derive, plugin)] #![plugin(serde_macros)]