mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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:
commit
2f0a9e7fce
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