Auto merge of #7167 - Ms2ger:unsafe-devtools, r=jdm

Disallow unsafe code in the devtools and devtools_traits crates.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7167)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-08-12 06:48:07 -06:00
commit 2f0a9e7fce
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
/// `None` if it isn't.
#[inline]
#[allow(unsafe_code)]
pub fn downcast_ref<T: Reflect + 'static>(&self) -> Option<&T> {
if self.is::<T>() {
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<T: Reflect + 'static>(&mut self) -> Option<&mut T> {
if self.is::<T>() {
unsafe {

View file

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

View file

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