diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2017-10-12 02:00:33 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2017-10-13 11:11:02 +0200 |
commit | 7ebedd02a9b8da03c9b5d5d8ff876beeedeb7ecf (patch) | |
tree | 64740d252d20c7b6e4add4433171776fca4e577b /components/script_layout_interface/lib.rs | |
parent | ff23a8536e53fda502dc17f8e9b3d32554ed1264 (diff) | |
download | servo-7ebedd02a9b8da03c9b5d5d8ff876beeedeb7ecf.tar.gz servo-7ebedd02a9b8da03c9b5d5d8ff876beeedeb7ecf.zip |
Use NonZeroUsize in script_layout_interface
Diffstat (limited to 'components/script_layout_interface/lib.rs')
-rw-r--r-- | components/script_layout_interface/lib.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs index ffc41351ee5..f81092a8492 100644 --- a/components/script_layout_interface/lib.rs +++ b/components/script_layout_interface/lib.rs @@ -7,12 +7,11 @@ //! to depend on script. #![deny(unsafe_code)] -#![feature(nonzero)] +#![cfg_attr(feature = "unstable", feature(nonzero))] extern crate app_units; extern crate atomic_refcell; extern crate canvas_traits; -extern crate core; extern crate cssparser; extern crate euclid; extern crate gfx_traits; @@ -26,6 +25,7 @@ extern crate log; extern crate metrics; extern crate msg; extern crate net_traits; +extern crate nonzero; extern crate profile_traits; extern crate range; extern crate script_traits; @@ -43,12 +43,13 @@ pub mod wrapper_traits; use atomic_refcell::AtomicRefCell; use canvas_traits::canvas::CanvasMsg; -use core::nonzero::NonZero; use ipc_channel::ipc::IpcSender; use libc::c_void; use net_traits::image_cache::PendingImageId; +use nonzero::NonZeroUsize; use script_traits::UntrustedNodeAddress; use servo_url::ServoUrl; +use std::marker::PhantomData; use std::sync::atomic::AtomicIsize; use style::data::ElementData; @@ -78,7 +79,8 @@ pub struct OpaqueStyleAndLayoutData { // NB: We really store a `StyleAndLayoutData` here, so be careful! #[ignore_heap_size_of = "TODO(#6910) Box value that should be counted but \ the type lives in layout"] - pub ptr: NonZero<*mut StyleData> + pub ptr: NonZeroUsize, + pub phantom: PhantomData<*mut StyleData>, } #[allow(unsafe_code)] |