Disallow unsafe code in the devtools and devtools_traits crates.

This commit is contained in:
Ms2ger 2015-08-12 13:16:31 +02:00
parent 3b1b3fe0a0
commit 38ed3a46d6
3 changed files with 5 additions and 0 deletions

View file

@ -44,6 +44,7 @@ impl Actor + Send {
/// Returns some reference to the boxed value if it is of type `T`, or /// Returns some reference to the boxed value if it is of type `T`, or
/// `None` if it isn't. /// `None` if it isn't.
#[inline] #[inline]
#[allow(unsafe_code)]
pub fn downcast_ref<T: Reflect + 'static>(&self) -> Option<&T> { pub fn downcast_ref<T: Reflect + 'static>(&self) -> Option<&T> {
if self.is::<T>() { if self.is::<T>() {
unsafe { unsafe {
@ -61,6 +62,7 @@ impl Actor + Send {
/// Returns some mutable reference to the boxed value if it is of type `T`, or /// Returns some mutable reference to the boxed value if it is of type `T`, or
/// `None` if it isn't. /// `None` if it isn't.
#[inline] #[inline]
#[allow(unsafe_code)]
pub fn downcast_mut<T: Reflect + 'static>(&mut self) -> Option<&mut T> { pub fn downcast_mut<T: Reflect + 'static>(&mut self) -> Option<&mut T> {
if self.is::<T>() { if self.is::<T>() {
unsafe { unsafe {

View file

@ -20,6 +20,7 @@
#![plugin(serde_macros)] #![plugin(serde_macros)]
#![allow(non_snake_case)] #![allow(non_snake_case)]
#![deny(unsafe_code)]
#[macro_use] #[macro_use]
extern crate log; extern crate log;

View file

@ -10,6 +10,8 @@
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![allow(non_snake_case)] #![allow(non_snake_case)]
#![deny(unsafe_code)]
#![feature(custom_derive, plugin)] #![feature(custom_derive, plugin)]
#![plugin(serde_macros)] #![plugin(serde_macros)]