Use NonZeroUsize in script_layout_interface

This commit is contained in:
Simon Sapin 2017-10-12 02:00:33 +02:00
parent ff23a8536e
commit 7ebedd02a9
8 changed files with 38 additions and 13 deletions

View file

@ -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)]