diff --git a/cargo-nightly-build b/cargo-nightly-build index c267da5f4cc..d9ca78f0ecd 100644 --- a/cargo-nightly-build +++ b/cargo-nightly-build @@ -1 +1 @@ -2015-02-07 +2015-03-11 diff --git a/components/canvas/lib.rs b/components/canvas/lib.rs index fb06eccc9f3..42fa6733998 100644 --- a/components/canvas/lib.rs +++ b/components/canvas/lib.rs @@ -5,8 +5,6 @@ #![feature(core)] #![feature(collections)] -#![allow(missing_copy_implementations)] - extern crate azure; extern crate cssparser; extern crate geom; diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 23bfe1fb536..ba8dfc3bb2c 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -208,8 +208,8 @@ impl IOCompositor { composition_request: CompositionRequest::NoCompositingNecessary, pending_scroll_events: Vec::new(), shutdown_state: ShutdownState::NotShuttingDown, - page_zoom: ScaleFactor(1.0), - viewport_zoom: ScaleFactor(1.0), + page_zoom: ScaleFactor::new(1.0), + viewport_zoom: ScaleFactor::new(1.0), zoom_action: false, zoom_time: 0f64, got_load_complete_message: false, @@ -893,7 +893,7 @@ impl IOCompositor { match opts::get().device_pixels_per_px { Some(device_pixels_per_px) => device_pixels_per_px, None => match opts::get().output_file { - Some(_) => ScaleFactor(1.0), + Some(_) => ScaleFactor::new(1.0), None => self.hidpi_factor } } @@ -905,7 +905,7 @@ impl IOCompositor { fn update_zoom_transform(&mut self) { let scale = self.device_pixels_per_page_px(); - self.scene.scale = ScaleFactor(scale.get()); + self.scene.scale = ScaleFactor::new(scale.get()); // We need to set the size of the root layer again, since the window size // has changed in unscaled layer pixels. @@ -913,7 +913,7 @@ impl IOCompositor { } fn on_zoom_window_event(&mut self, magnification: f32) { - self.page_zoom = ScaleFactor((self.page_zoom.get() * magnification).max(1.0)); + self.page_zoom = ScaleFactor::new((self.page_zoom.get() * magnification).max(1.0)); self.update_zoom_transform(); self.send_window_size(); } @@ -924,7 +924,7 @@ impl IOCompositor { self.zoom_time = precise_time_s(); let old_viewport_zoom = self.viewport_zoom; - self.viewport_zoom = ScaleFactor((self.viewport_zoom.get() * magnification).max(1.0)); + self.viewport_zoom = ScaleFactor::new((self.viewport_zoom.get() * magnification).max(1.0)); let viewport_zoom = self.viewport_zoom; self.update_zoom_transform(); diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 2f5a9059423..33cec1761c5 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -307,8 +307,8 @@ impl CompositorLayer for Layer { let min_x = (layer_size.width - content_size.width).get().min(0.0); let min_y = (layer_size.height - content_size.height).get().min(0.0); let new_offset : TypedPoint2D = - Point2D(Length(new_offset.x.get().clamp(&min_x, &0.0)), - Length(new_offset.y.get().clamp(&min_y, &0.0))); + Point2D(Length::new(new_offset.x.get().clamp(&min_x, &0.0)), + Length::new(new_offset.y.get().clamp(&min_y, &0.0))); if self.extra_data.borrow().scroll_offset == new_offset { return ScrollEventResult::ScrollPositionUnchanged; diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 58057c94eb1..f5171e817cf 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -34,6 +34,7 @@ use util::time::TimeProfilerChan; use std::borrow::ToOwned; use std::collections::{HashMap}; use std::old_io as io; +use std::marker::PhantomData; use std::mem::replace; use std::sync::mpsc::{Receiver, channel}; use url::Url; @@ -95,6 +96,8 @@ pub struct Constellation { /// A channel through which messages can be sent to the memory profiler. pub memory_profiler_chan: MemoryProfilerChan, + phantom: PhantomData<(LTF, STF)>, + pub window_size: WindowSizeData, } @@ -201,10 +204,11 @@ impl Constellation { time_profiler_chan: time_profiler_chan, memory_profiler_chan: memory_profiler_chan, window_size: WindowSizeData { - visible_viewport: opts::get().initial_window_size.as_f32() * ScaleFactor(1.0), - initial_viewport: opts::get().initial_window_size.as_f32() * ScaleFactor(1.0), - device_pixel_ratio: ScaleFactor(1.0), + visible_viewport: opts::get().initial_window_size.as_f32() * ScaleFactor::new(1.0), + initial_viewport: opts::get().initial_window_size.as_f32() * ScaleFactor::new(1.0), + device_pixel_ratio: ScaleFactor::new(1.0), }, + phantom: PhantomData, }; constellation.run(); }); @@ -227,7 +231,7 @@ impl Constellation { self.pipeline(pipeline_id).rect.map(|rect| { WindowSizeData { visible_viewport: rect.size, - initial_viewport: rect.size * ScaleFactor(1.0), + initial_viewport: rect.size * ScaleFactor::new(1.0), device_pixel_ratio: self.window_size.device_pixel_ratio, } }) @@ -448,7 +452,7 @@ impl Constellation { let ScriptControlChan(ref script_chan) = script_chan; script_chan.send(ConstellationControlMsg::Resize(pipeline_id, WindowSizeData { visible_viewport: rect.size, - initial_viewport: rect.size * ScaleFactor(1.0), + initial_viewport: rect.size * ScaleFactor::new(1.0), device_pixel_ratio: self.window_size.device_pixel_ratio, })).unwrap(); diff --git a/components/compositing/headless.rs b/components/compositing/headless.rs index d25fc4f59e1..18cf76961a7 100644 --- a/components/compositing/headless.rs +++ b/components/compositing/headless.rs @@ -59,7 +59,7 @@ impl NullCompositor { chan.send(ConstellationMsg::ResizedWindow(WindowSizeData { initial_viewport: TypedSize2D(640_f32, 480_f32), visible_viewport: TypedSize2D(640_f32, 480_f32), - device_pixel_ratio: ScaleFactor(1.0), + device_pixel_ratio: ScaleFactor::new(1.0), })).unwrap(); } diff --git a/components/devtools/Cargo.toml b/components/devtools/Cargo.toml index a97c9f1c4a9..6503aa125cb 100644 --- a/components/devtools/Cargo.toml +++ b/components/devtools/Cargo.toml @@ -18,4 +18,4 @@ path = "../util" [dependencies] time = "*" -rustc-serialize = "0.2" +rustc-serialize = "0.3" diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs index 1b31e5e7166..78f4cd951fe 100644 --- a/components/devtools/lib.rs +++ b/components/devtools/lib.rs @@ -14,7 +14,6 @@ #![feature(collections, std_misc)] #![allow(non_snake_case)] -#![allow(missing_copy_implementations)] #[macro_use] extern crate log; diff --git a/components/devtools_traits/Cargo.toml b/components/devtools_traits/Cargo.toml index e263f2fa299..465f751e852 100644 --- a/components/devtools_traits/Cargo.toml +++ b/components/devtools_traits/Cargo.toml @@ -15,4 +15,4 @@ path = "../util" [dependencies] url = "0.2.16" -rustc-serialize = "0.2" +rustc-serialize = "0.3" diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index bb83117740e..9ea3772b665 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -12,7 +12,6 @@ #![feature(int_uint)] #![allow(non_snake_case)] -#![allow(missing_copy_implementations)] extern crate msg; extern crate "rustc-serialize" as rustc_serialize; diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 359bc97e841..ee9d4990da9 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -67,5 +67,5 @@ path = "../script_traits" url = "0.2.16" time = "0.1.12" bitflags = "*" -rustc-serialize = "0.2" +rustc-serialize = "0.3" libc = "*" diff --git a/components/gfx/buffer_map.rs b/components/gfx/buffer_map.rs index c33617a7c9e..c16ae23eb13 100644 --- a/components/gfx/buffer_map.rs +++ b/components/gfx/buffer_map.rs @@ -7,7 +7,7 @@ use std::collections::hash_map::Entry::{Occupied, Vacant}; use geom::size::Size2D; use layers::platform::surface::NativePaintingGraphicsContext; use layers::layers::LayerBuffer; -use std::hash::{Hash, Hasher, Writer}; +use std::hash::{Hash, Hasher}; use std::mem; /// This is a struct used to store buffers when they are not in use. @@ -29,8 +29,8 @@ pub struct BufferMap { #[derive(Eq, Copy)] struct BufferKey([uint; 2]); -impl Hash for BufferKey { - fn hash(&self, state: &mut H) { +impl Hash for BufferKey { + fn hash(&self, state: &mut H) { let BufferKey(ref bytes) = *self; bytes.as_slice().hash(state); } diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index 808f2027213..3fe671fc888 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -16,7 +16,7 @@ #![feature(unicode)] #![feature(unsafe_destructor)] -#![allow(missing_copy_implementations)] +#![plugin(plugins)] #[macro_use] extern crate log; @@ -32,8 +32,6 @@ extern crate png; extern crate script_traits; extern crate "rustc-serialize" as rustc_serialize; extern crate unicode; -#[no_link] #[plugin] -extern crate "plugins" as servo_plugins; extern crate net; #[macro_use] extern crate util; diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 442e13f7333..88c031a165f 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -850,9 +850,11 @@ impl<'a> PaintContext<'a> { // Draw the text. let temporary_draw_target = self.create_draw_target_for_blur_if_necessary(&text.base.bounds, text.blur_radius); - self.font_context - .get_paint_font_from_template(&text.text_run.font_template, - text.text_run.actual_pt_size) + { + // FIXME(https://github.com/rust-lang/rust/issues/23338) + let font = self.font_context.get_paint_font_from_template( + &text.text_run.font_template, text.text_run.actual_pt_size); + font .borrow() .draw_text(&temporary_draw_target.draw_target, &*text.text_run, @@ -860,6 +862,7 @@ impl<'a> PaintContext<'a> { baseline_origin, text.text_color, opts::get().enable_text_antialiasing); + } // Blur, if necessary. self.blur_if_necessary(temporary_draw_target, text.blur_radius); diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 731842d3f89..b21e861a8f8 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -134,7 +134,7 @@ macro_rules! native_graphics_context( ) ); -impl PaintTask where C: PaintListener + Send { +impl PaintTask where C: PaintListener + Send + 'static { pub fn create(id: PipelineId, port: Receiver, compositor: C, diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 5447ff64047..733985cefde 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -52,7 +52,7 @@ git = "https://github.com/servo/rust-geom" [dependencies.string_cache] git = "https://github.com/servo/string-cache" -[dependencies.string_cache_macros] +[dependencies.string_cache_plugin] git = "https://github.com/servo/string-cache" [dependencies.png] @@ -62,5 +62,5 @@ git = "https://github.com/servo/rust-png" encoding = "0.2" url = "0.2.16" bitflags = "*" -rustc-serialize = "0.2" +rustc-serialize = "0.3" libc = "*" diff --git a/components/layout/block.rs b/components/layout/block.rs index 9c8ae1a19d6..1f6b64a97d2 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1823,7 +1823,7 @@ impl Flow for BlockFlow { self.base .absolute_position_info .relative_containing_block_mode, - CoordinateSystem::Self); + CoordinateSystem::Own); let clip = self.fragment.clipping_region_for_children(&clip_in_child_coordinate_system, &stacking_relative_border_box); diff --git a/components/layout/construct.rs b/components/layout/construct.rs index bcc218702d2..a30f3aee701 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -52,7 +52,7 @@ use script::dom::htmlobjectelement::is_image_data; use script::dom::node::NodeTypeId; use util::opts; use std::borrow::ToOwned; -use std::collections::DList; +use std::collections::LinkedList; use std::mem; use std::sync::atomic::Ordering; use style::computed_values::content::ContentItem; @@ -114,10 +114,10 @@ pub enum ConstructionItem { #[derive(Clone)] pub struct InlineFragmentsConstructionResult { /// Any {ib} splits that we're bubbling up. - pub splits: DList, + pub splits: LinkedList, /// Any fragments that succeed the {ib} splits. - pub fragments: DList, + pub fragments: LinkedList, /// Any absolute descendants that we're bubbling up. pub abs_descendants: AbsDescendants, @@ -152,7 +152,7 @@ pub struct InlineFragmentsConstructionResult { #[derive(Clone)] pub struct InlineBlockSplit { /// The inline fragments that precede the flow. - pub predecessors: DList, + pub predecessors: LinkedList, /// The flow that caused this {ib} split. pub flow: FlowRef, @@ -161,7 +161,7 @@ pub struct InlineBlockSplit { /// Holds inline fragments that we're gathering for children of an inline node. struct InlineFragmentsAccumulator { /// The list of fragments. - fragments: DList, + fragments: LinkedList, /// Whether we've created a range to enclose all the fragments. This will be Some() if the /// outer node is an inline and None otherwise. @@ -171,20 +171,20 @@ struct InlineFragmentsAccumulator { impl InlineFragmentsAccumulator { fn new() -> InlineFragmentsAccumulator { InlineFragmentsAccumulator { - fragments: DList::new(), + fragments: LinkedList::new(), enclosing_style: None, } } fn from_inline_node(node: &ThreadSafeLayoutNode) -> InlineFragmentsAccumulator { - let fragments = DList::new(); + let fragments = LinkedList::new(); InlineFragmentsAccumulator { fragments: fragments, enclosing_style: Some(node.style().clone()), } } - fn push_all(&mut self, mut fragments: DList) { + fn push_all(&mut self, mut fragments: LinkedList) { if fragments.len() == 0 { return } @@ -192,7 +192,7 @@ impl InlineFragmentsAccumulator { self.fragments.append(&mut fragments) } - fn to_dlist(self) -> DList { + fn to_dlist(self) -> LinkedList { let InlineFragmentsAccumulator { mut fragments, enclosing_style @@ -507,7 +507,7 @@ impl<'a> FlowConstructor<'a> { fn build_flow_for_block_starting_with_fragments(&mut self, mut flow: FlowRef, node: &ThreadSafeLayoutNode, - mut initial_fragments: DList) + mut initial_fragments: LinkedList) -> ConstructionResult { // Gather up fragments for the inline flows we might need to create. let mut inline_fragment_accumulator = InlineFragmentsAccumulator::new(); @@ -577,7 +577,7 @@ impl<'a> FlowConstructor<'a> { /// `