From 12d19760b37ee0271152695a1ac9ca040e72fa8d Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 28 Jan 2019 11:23:51 +0100 Subject: [PATCH 1/2] Upgrade to rustc 1.34.0-nightly (da6ab956e 2019-01-27) --- Cargo.lock | 2 ++ components/script_plugins/unrooted_must_root.rs | 4 ++++ rust-toolchain | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index a6d4544e957..74faaeff413 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "adler32" version = "1.0.3" diff --git a/components/script_plugins/unrooted_must_root.rs b/components/script_plugins/unrooted_must_root.rs index dc38054720c..e1a78908033 100644 --- a/components/script_plugins/unrooted_must_root.rs +++ b/components/script_plugins/unrooted_must_root.rs @@ -100,6 +100,10 @@ fn is_unrooted_ty(cx: &LateContext, ty: &ty::TyS, in_new_function: bool) -> bool } impl LintPass for UnrootedPass { + fn name(&self) -> &'static str { + "ServoUnrootedPass" + } + fn get_lints(&self) -> LintArray { lint_array!(UNROOTED_MUST_ROOT) } diff --git a/rust-toolchain b/rust-toolchain index 3bd0575c240..452bb5c2b97 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2019-01-15 +nightly-2019-01-28 From 7cf98f6b016e2f6d39bd9da253612a55cf38e013 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 28 Jan 2019 11:32:40 +0100 Subject: [PATCH 2/2] Fix deprecation warnings --- components/config/opts.rs | 4 ++-- components/gfx/font.rs | 4 ++-- components/gfx/font_context.rs | 4 ++-- components/gfx_traits/lib.rs | 4 ++-- components/layout/layout_debug.rs | 4 ++-- components/profile/heartbeats.rs | 4 ++-- 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> = 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> = 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(work: F) -> R where