Skip to content

Commit

Permalink
Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0…
Browse files Browse the repository at this point in the history
…-dev.
  • Loading branch information
Ms2ger authored and jdm committed Mar 18, 2015
1 parent 65d4b12 commit 5f15eb5
Show file tree
Hide file tree
Showing 140 changed files with 1,420 additions and 1,222 deletions.
2 changes: 1 addition & 1 deletion cargo-nightly-build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2015-02-07
2015-03-11
2 changes: 0 additions & 2 deletions components/canvas/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#![feature(core)]
#![feature(collections)]

#![allow(missing_copy_implementations)]

extern crate azure;
extern crate cssparser;
extern crate geom;
Expand Down
12 changes: 6 additions & 6 deletions components/compositing/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
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,
Expand Down Expand Up @@ -893,7 +893,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
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
}
}
Expand All @@ -905,15 +905,15 @@ impl<Window: WindowMethods> IOCompositor<Window> {

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.
self.scene.set_root_layer_size(self.window_size.as_f32());
}

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();
}
Expand All @@ -924,7 +924,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
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();
Expand Down
4 changes: 2 additions & 2 deletions components/compositing/compositor_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ impl CompositorLayer for Layer<CompositorData> {
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<LayerPixel, f32> =
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;
Expand Down
14 changes: 9 additions & 5 deletions components/compositing/constellation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -95,6 +96,8 @@ pub struct Constellation<LTF, STF> {
/// 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,
}

Expand Down Expand Up @@ -201,10 +204,11 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
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();
});
Expand All @@ -227,7 +231,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
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,
}
})
Expand Down Expand Up @@ -448,7 +452,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
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();

Expand Down
2 changes: 1 addition & 1 deletion components/compositing/headless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion components/devtools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ path = "../util"

[dependencies]
time = "*"
rustc-serialize = "0.2"
rustc-serialize = "0.3"
1 change: 0 additions & 1 deletion components/devtools/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#![feature(collections, std_misc)]

#![allow(non_snake_case)]
#![allow(missing_copy_implementations)]

#[macro_use]
extern crate log;
Expand Down
2 changes: 1 addition & 1 deletion components/devtools_traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ path = "../util"

[dependencies]
url = "0.2.16"
rustc-serialize = "0.2"
rustc-serialize = "0.3"
1 change: 0 additions & 1 deletion components/devtools_traits/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion components/gfx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "*"
6 changes: 3 additions & 3 deletions components/gfx/buffer_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -29,8 +29,8 @@ pub struct BufferMap {
#[derive(Eq, Copy)]
struct BufferKey([uint; 2]);

impl<H: Hasher+Writer> Hash<H> for BufferKey {
fn hash(&self, state: &mut H) {
impl Hash for BufferKey {
fn hash<H: Hasher>(&self, state: &mut H) {
let BufferKey(ref bytes) = *self;
bytes.as_slice().hash(state);
}
Expand Down
4 changes: 1 addition & 3 deletions components/gfx/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#![feature(unicode)]
#![feature(unsafe_destructor)]

#![allow(missing_copy_implementations)]
#![plugin(plugins)]

#[macro_use]
extern crate log;
Expand All @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions components/gfx/paint_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,16 +850,19 @@ 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,
&text.range,
baseline_origin,
text.text_color,
opts::get().enable_text_antialiasing);
}

// Blur, if necessary.
self.blur_if_necessary(temporary_draw_target, text.blur_radius);
Expand Down
2 changes: 1 addition & 1 deletion components/gfx/paint_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ macro_rules! native_graphics_context(
)
);

impl<C> PaintTask<C> where C: PaintListener + Send {
impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
pub fn create(id: PipelineId,
port: Receiver<Msg>,
compositor: C,
Expand Down
4 changes: 2 additions & 2 deletions components/layout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 = "*"
2 changes: 1 addition & 1 deletion components/layout/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 5f15eb5

Please sign in to comment.