aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-01-28 11:32:40 +0100
committerSimon Sapin <simon.sapin@exyr.org>2019-01-28 11:32:40 +0100
commit7cf98f6b016e2f6d39bd9da253612a55cf38e013 (patch)
tree2ef5fdccc4714705e3f0fbf249fee4939af167d3 /components
parent12d19760b37ee0271152695a1ac9ca040e72fa8d (diff)
downloadservo-7cf98f6b016e2f6d39bd9da253612a55cf38e013.tar.gz
servo-7cf98f6b016e2f6d39bd9da253612a55cf38e013.zip
Fix deprecation warnings
Diffstat (limited to 'components')
-rw-r--r--components/config/opts.rs4
-rw-r--r--components/gfx/font.rs4
-rw-r--r--components/gfx/font_context.rs4
-rw-r--r--components/gfx_traits/lib.rs4
-rw-r--r--components/layout/layout_debug.rs4
-rw-r--r--components/profile/heartbeats.rs4
6 files changed, 12 insertions, 12 deletions
diff --git a/components/config/opts.rs b/components/config/opts.rs
index ffdb49d6a45..63673310528 100644
--- a/components/config/opts.rs
+++ b/components/config/opts.rs
@@ -18,7 +18,7 @@ use std::fs::{self, File};
use std::io::{self, Read, Write};
use std::path::{Path, PathBuf};
use std::process;
-use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
+use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{RwLock, RwLockReadGuard};
use url::{self, Url};
@@ -490,7 +490,7 @@ fn args_fail(msg: &str) -> ! {
process::exit(1)
}
-static MULTIPROCESS: AtomicBool = ATOMIC_BOOL_INIT;
+static MULTIPROCESS: AtomicBool = AtomicBool::new(false);
#[inline]
pub fn multiprocess() -> bool {
diff --git a/components/gfx/font.rs b/components/gfx/font.rs
index 46dc113fa76..6a0000494c5 100644
--- a/components/gfx/font.rs
+++ b/components/gfx/font.rs
@@ -22,7 +22,7 @@ use std::collections::HashMap;
use std::iter;
use std::rc::Rc;
use std::str;
-use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
+use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use style::computed_values::{font_stretch, font_style, font_variant_caps, font_weight};
use style::properties::style_structs::Font as FontStyleStruct;
@@ -39,7 +39,7 @@ pub const GPOS: u32 = ot_tag!('G', 'P', 'O', 'S');
pub const GSUB: u32 = ot_tag!('G', 'S', 'U', 'B');
pub const KERN: u32 = ot_tag!('k', 'e', 'r', 'n');
-static TEXT_SHAPING_PERFORMANCE_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
+static TEXT_SHAPING_PERFORMANCE_COUNTER: AtomicUsize = AtomicUsize::new(0);
// FontHandle encapsulates access to the platform's font API,
// e.g. quartz, FreeType. It provides access to metrics and tables
diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs
index d33c3cff602..06755205935 100644
--- a/components/gfx/font_context.rs
+++ b/components/gfx/font_context.rs
@@ -18,7 +18,7 @@ use std::collections::HashMap;
use std::default::Default;
use std::hash::{BuildHasherDefault, Hash, Hasher};
use std::rc::Rc;
-use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
+use std::sync::atomic::{AtomicUsize, Ordering};
use style::computed_values::font_variant_caps::T as FontVariantCaps;
use style::properties::style_structs::Font as FontStyleStruct;
@@ -26,7 +26,7 @@ static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h)
/// An epoch for the font context cache. The cache is flushed if the current epoch does not match
/// this one.
-static FONT_CACHE_EPOCH: AtomicUsize = ATOMIC_USIZE_INIT;
+static FONT_CACHE_EPOCH: AtomicUsize = AtomicUsize::new(0);
pub trait FontSource {
fn get_font_instance(
diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs
index 9073e58e690..a3a85499a9e 100644
--- a/components/gfx_traits/lib.rs
+++ b/components/gfx_traits/lib.rs
@@ -16,7 +16,7 @@ extern crate serde;
pub mod print_tree;
use range::RangeIndex;
-use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
+use std::sync::atomic::{AtomicUsize, Ordering};
/// A newtype struct for denoting the age of messages; prevents race conditions.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
@@ -75,7 +75,7 @@ pub enum FragmentType {
/// The next ID that will be used for a special scroll root id.
///
/// A special scroll root is a scroll root that is created for generated content.
-static NEXT_SPECIAL_SCROLL_ROOT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
+static NEXT_SPECIAL_SCROLL_ROOT_ID: AtomicUsize = AtomicUsize::new(0);
/// If none of the bits outside this mask are set, the scroll root is a special scroll root.
/// Note that we assume that the top 16 bits of the address space are unused on the platform.
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index c44fcd7e25f..d3af6b4d8d5 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -13,12 +13,12 @@ use std::cell::RefCell;
use std::fs::File;
use std::io::Write;
#[cfg(debug_assertions)]
-use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
+use std::sync::atomic::{AtomicUsize, Ordering};
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
#[cfg(debug_assertions)]
-static DEBUG_ID_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
+static DEBUG_ID_COUNTER: AtomicUsize = AtomicUsize::new(0);
pub struct Scope;
diff --git a/components/profile/heartbeats.rs b/components/profile/heartbeats.rs
index 9626f598839..2d9618322d8 100644
--- a/components/profile/heartbeats.rs
+++ b/components/profile/heartbeats.rs
@@ -144,12 +144,12 @@ mod synchronized_heartbeat {
use heartbeats_simple::HeartbeatPowContext as HeartbeatContext;
use profile_traits::time::ProfilerCategory;
use std::collections::HashMap;
- use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
+ use std::sync::atomic::{AtomicBool, Ordering};
static mut HBS: Option<*mut HashMap<ProfilerCategory, Heartbeat>> = None;
// unfortunately can't encompass the actual hashmap in a Mutex (Heartbeat isn't Send/Sync), so we'll use a spinlock
- static HBS_SPINLOCK: AtomicBool = ATOMIC_BOOL_INIT;
+ static HBS_SPINLOCK: AtomicBool = AtomicBool::new(false);
pub fn lock_and_work<F, R>(work: F) -> R
where