aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/cell.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-19 07:40:22 +0530
committerMs2ger <ms2ger@gmail.com>2015-03-21 10:27:32 +0100
commit3479d3fa7fbbfbcdbc92a93896b4a347338fe103 (patch)
treed05bd5d1964dfad791132d2384950cc681597f6e /components/script/dom/bindings/cell.rs
parent4eb26065acdc37d275e658d8581282cb39b90686 (diff)
downloadservo-3479d3fa7fbbfbcdbc92a93896b4a347338fe103.tar.gz
servo-3479d3fa7fbbfbcdbc92a93896b4a347338fe103.zip
Replace unsafe_blocks by unsafe_code.
Diffstat (limited to 'components/script/dom/bindings/cell.rs')
-rw-r--r--components/script/dom/bindings/cell.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs
index 18ea62d7106..f2a1504f8b9 100644
--- a/components/script/dom/bindings/cell.rs
+++ b/components/script/dom/bindings/cell.rs
@@ -27,6 +27,7 @@ impl<T> DOMRefCell<T> {
/// Return a reference to the contents.
///
/// For use in the layout task only.
+ #[allow(unsafe_code)]
pub unsafe fn borrow_for_layout<'a>(&'a self) -> &'a T {
debug_assert!(task_state::get().is_layout());
&*self.value.as_unsafe_cell().get()
@@ -36,6 +37,7 @@ impl<T> DOMRefCell<T> {
///
/// This succeeds even if the object is mutably borrowed,
/// so you have to be careful in trace code!
+ #[allow(unsafe_code)]
pub unsafe fn borrow_for_gc_trace<'a>(&'a self) -> &'a T {
debug_assert!(task_state::get().contains(SCRIPT | IN_GC));
&*self.value.as_unsafe_cell().get()
@@ -43,6 +45,7 @@ impl<T> DOMRefCell<T> {
/// Borrow the contents for the purpose of script deallocation.
///
+ #[allow(unsafe_code)]
pub unsafe fn borrow_for_script_deallocation<'a>(&'a self) -> &'a mut T {
debug_assert!(task_state::get().contains(SCRIPT));
&mut *self.value.as_unsafe_cell().get()