mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Disallow unsafe code in the devtools and devtools_traits crates.
This commit is contained in:
parent
3b1b3fe0a0
commit
38ed3a46d6
3 changed files with 5 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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)]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue