Skip to content
Permalink
Browse files

Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)

  • Loading branch information
kmcallister committed Sep 20, 2014
1 parent 8a7eefe commit a640a7c5c34f914d3c8515f9b89ae78919af4913
Showing with 460 additions and 450 deletions.
  1. +126 −118 Cargo.lock
  2. +2 −1 components/compositing/compositor.rs
  3. +2 −2 components/compositing/compositor_task.rs
  4. +3 −3 components/compositing/lib.rs
  5. +5 −6 components/devtools/actor.rs
  6. +3 −4 components/devtools/lib.rs
  7. +1 −1 components/devtools_traits/lib.rs
  8. +1 −1 components/gfx/color.rs
  9. +1 −1 components/gfx/display_list/mod.rs
  10. +4 −4 components/gfx/lib.rs
  11. +1 −1 components/gfx/platform/freetype/font.rs
  12. +2 −2 components/gfx/platform/freetype/font_context.rs
  13. +5 −5 components/gfx/platform/freetype/font_list.rs
  14. +1 −1 components/gfx/platform/macos/font.rs
  15. +6 −6 components/gfx/text/shaping/harfbuzz.rs
  16. +1 −1 components/gfx/text/shaping/mod.rs
  17. +41 −22 components/layout/block.rs
  18. +6 −6 components/layout/flow.rs
  19. +5 −5 components/layout/flow_ref.rs
  20. +4 −4 components/layout/lib.rs
  21. +1 −1 components/layout/model.rs
  22. +1 −1 components/layout/util.rs
  23. +3 −3 components/layout_traits/lib.rs
  24. +2 −2 components/macros/lib.rs
  25. +2 −2 components/msg/compositor_msg.rs
  26. +1 −2 components/msg/lib.rs
  27. +2 −1 components/net/about_loader.rs
  28. +1 −1 components/net/data_loader.rs
  29. +1 −1 components/net/fetch/request.rs
  30. +1 −1 components/net/fetch/response.rs
  31. +2 −2 components/net/http_loader.rs
  32. +1 −1 components/net/image/base.rs
  33. +1 −1 components/net/image_cache_task.rs
  34. +1 −1 components/net/lib.rs
  35. +3 −3 components/net/resource_task.rs
  36. +8 −8 components/script/cors.rs
  37. +1 −1 components/script/dom/bindings/callback.rs
  38. +3 −3 components/script/dom/bindings/codegen/CodegenRust.py
  39. +2 −2 components/script/dom/bindings/error.rs
  40. +1 −1 components/script/dom/bindings/js.rs
  41. +37 −43 components/script/dom/bindings/proxyhandler.rs
  42. +12 −16 components/script/dom/bindings/utils.rs
  43. +1 −1 components/script/dom/browsercontext.rs
  44. +3 −3 components/script/dom/dedicatedworkerglobalscope.rs
  45. +1 −1 components/script/dom/element.rs
  46. +1 −1 components/script/dom/eventtarget.rs
  47. +3 −3 components/script/dom/htmlcollection.rs
  48. +2 −2 components/script/dom/node.rs
  49. +5 −5 components/script/dom/urlsearchparams.rs
  50. +38 −38 components/script/dom/virtualmethods.rs
  51. +7 −5 components/script/dom/window.rs
  52. +3 −3 components/script/dom/worker.rs
  53. +8 −5 components/script/dom/xmlhttprequest.rs
  54. +4 −4 components/script/lib.rs
  55. +3 −3 components/script/page.rs
  56. +8 −8 components/script/script_task.rs
  57. +2 −3 components/script_traits/lib.rs
  58. +2 −2 components/style/lib.rs
  59. +5 −5 components/style/parsing_utils.rs
  60. +3 −4 components/style/properties/common_types.rs
  61. +18 −27 components/style/properties/mod.rs.mako
  62. +1 −2 components/util/Cargo.toml
  63. +1 −1 components/util/lib.rs
  64. +4 −3 components/util/memory.rs
  65. +10 −10 components/util/smallvec.rs
  66. +2 −1 components/util/time.rs
  67. +2 −2 components/util/workqueue.rs
  68. +5 −5 ports/cef/lib.rs
  69. +1 −1 rust-snapshot-hash
  70. +5 −5 src/lib.rs
  71. +1 −1 src/main.rs
  72. +1 −1 support/glfw-rs
  73. +2 −3 tests/contenttest.rs
  74. +1 −1 tests/reftest.rs

Large diffs are not rendered by default.

@@ -22,6 +22,7 @@ use windowing::PinchZoomWindowEvent;
use azure::azure_hl::SourceSurfaceMethods;
use azure::azure_hl;
use std::cmp;
use std::time::duration::Duration;
use geom::point::{Point2D, TypedPoint2D};
use geom::rect::Rect;
use geom::size::TypedSize2D;
@@ -223,7 +224,7 @@ impl IOCompositor {
self.composite();
}

sleep(10);
sleep(Duration::milliseconds(10));

// If a pinch-zoom happened recently, ask for tiles at the new resolution
if self.zoom_action && precise_time_s() - self.zoom_time > 0.3 {
@@ -56,8 +56,8 @@ impl ScriptListener for CompositorChan {
port.recv();
}

fn dup(&self) -> Box<ScriptListener> {
box self.clone() as Box<ScriptListener>
fn dup(&self) -> Box<ScriptListener+'static> {
box self.clone() as Box<ScriptListener+'static>
}
}

@@ -28,10 +28,10 @@ extern crate layout_traits;
extern crate opengles;
extern crate png;
extern crate script_traits;
extern crate servo_msg = "msg";
extern crate servo_net = "net";
extern crate "msg" as servo_msg;
extern crate "net" as servo_net;
#[phase(plugin, link)]
extern crate servo_util = "util";
extern crate "util" as servo_util;

extern crate libc;
extern crate time;
@@ -8,7 +8,7 @@ use std::any::{Any, AnyRefExt, AnyMutRefExt};
use std::collections::hashmap::HashMap;
use std::cell::{Cell, RefCell};
use std::io::TcpStream;
use std::mem::{transmute, transmute_copy};
use std::mem::{transmute, transmute_copy, replace};
use std::raw::TraitObject;
use serialize::json;

@@ -24,7 +24,7 @@ pub trait Actor: Any {
fn name(&self) -> String;
}

impl<'a> AnyMutRefExt<'a> for &'a mut Actor {
impl<'a> AnyMutRefExt<'a> for &'a mut Actor + 'a {
fn downcast_mut<T: 'static>(self) -> Option<&'a mut T> {
if self.is::<T>() {
unsafe {
@@ -40,7 +40,7 @@ impl<'a> AnyMutRefExt<'a> for &'a mut Actor {
}
}

impl<'a> AnyRefExt<'a> for &'a Actor {
impl<'a> AnyRefExt<'a> for &'a Actor + 'a {
fn is<T: 'static>(self) -> bool {
//FIXME: This implementation is bogus since get_type_id is private now.
// However, this implementation is only needed so long as there's a Rust bug
@@ -162,10 +162,9 @@ impl ActorRegistry {
}
}
}
let mut new_actors = self.new_actors.borrow_mut();
for &actor in new_actors.iter() {
let mut new_actors = replace(&mut *self.new_actors.borrow_mut(), vec!());
for actor in new_actors.into_iter() {
self.actors.insert(actor.name().to_string(), actor);
}
new_actors.clear();
}
}
@@ -22,10 +22,9 @@ extern crate collections;
extern crate core;
extern crate devtools_traits;
extern crate debug;
extern crate std;
extern crate serialize;
extern crate sync;
extern crate servo_msg = "msg";
extern crate "msg" as servo_msg;

use actor::{Actor, ActorRegistry};
use actors::console::ConsoleActor;
@@ -181,8 +180,8 @@ fn run_server(port: Receiver<DevtoolsControlMsg>) {
//TODO: make constellation send ServerExitMsg on shutdown.

// accept connections and process them, spawning a new tasks for each one
for stream in acceptor.incoming() {
match stream {
loop {
match acceptor.accept() {
Err(ref e) if e.kind == TimedOut => {
match port.try_recv() {
Ok(ServerExitMsg) | Err(Disconnected) => break,
@@ -8,7 +8,7 @@
#![comment = "The Servo Parallel Browser Project"]
#![license = "MPL"]

extern crate servo_msg = "msg";
extern crate "msg" as servo_msg;

/// This module contains shared types and messages for use by devtools/script.
/// The traits are here instead of in script so that the devtools crate can be
@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use azure::AzFloat;
use AzColor = azure::azure_hl::Color;
use azure::azure_hl::Color as AzColor;

pub type Color = AzColor;

@@ -134,7 +134,7 @@ impl ScaledFontExtensionMethods for ScaledFont {
&mut glyphbuf,
azure_pattern,
&mut options,
ptr::mut_null());
ptr::null_mut());
}
}
}
@@ -22,11 +22,11 @@ extern crate stb_image;
extern crate png;
extern crate serialize;
#[phase(plugin)]
extern crate servo_macros = "macros";
extern crate servo_net = "net";
extern crate "macros" as servo_macros;
extern crate "net" as servo_net;
#[phase(plugin, link)]
extern crate servo_util = "util";
extern crate servo_msg = "msg";
extern crate "util" as servo_util;
extern crate "msg" as servo_msg;
extern crate style;
extern crate sync;
extern crate url;
@@ -96,7 +96,7 @@ impl FontHandleMethods for FontHandle {
fn create_face_from_buffer(lib: FT_Library, cbuf: *const u8, cbuflen: uint, pt_size: Option<f64>)
-> Result<FT_Face, ()> {
unsafe {
let mut face: FT_Face = ptr::mut_null();
let mut face: FT_Face = ptr::null_mut();
let face_index = 0 as FT_Long;
let result = FT_New_Memory_Face(lib, cbuf, cbuflen as FT_Long,
face_index, &mut face);
@@ -61,13 +61,13 @@ impl FontContextHandle {
let ptr = libc::malloc(mem::size_of::<struct_FT_MemoryRec_>() as size_t);
let allocator: &mut struct_FT_MemoryRec_ = mem::transmute(ptr);
ptr::write(allocator, struct_FT_MemoryRec_ {
user: ptr::mut_null(),
user: ptr::null_mut(),
alloc: ft_alloc,
free: ft_free,
realloc: ft_realloc,
});

let mut ctx: FT_Library = ptr::mut_null();
let mut ctx: FT_Library = ptr::null_mut();

let result = FT_New_Library(ptr as FT_Memory, &mut ctx);
if !result.succeeded() { fail!("Unable to initialize FreeType library"); }
@@ -35,7 +35,7 @@ pub fn get_available_families(callback: |String|) {
let fontSet = FcConfigGetFonts(config, FcSetSystem);
for i in range(0, (*fontSet).nfont as int) {
let font = (*fontSet).fonts.offset(i);
let mut family: *mut FcChar8 = ptr::mut_null();
let mut family: *mut FcChar8 = ptr::null_mut();
let mut v: c_int = 0;
while FcPatternGetString(*font, FC_FAMILY.as_ptr() as *mut i8, v, &mut family) == FcResultMatch {
let family_name = string::raw::from_buf(family as *const i8 as *const u8);
@@ -71,7 +71,7 @@ pub fn get_variations_for_family(family_name: &str, callback: |String|) {

for i in range(0, (*matches).nfont as int) {
let font = (*matches).fonts.offset(i);
let mut file: *mut FcChar8 = ptr::mut_null();
let mut file: *mut FcChar8 = ptr::null_mut();
let file = if FcPatternGetString(*font, FC_FILE.as_ptr() as *mut i8, 0, &mut file) == FcResultMatch {
string::raw::from_buf(file as *const i8 as *const u8)
} else {
@@ -103,14 +103,14 @@ pub fn get_system_default_family(generic_name: &str) -> Option<String> {
unsafe {
let pattern = FcNameParse(generic_name_ptr as *mut FcChar8);

FcConfigSubstitute(ptr::mut_null(), pattern, FcMatchPattern);
FcConfigSubstitute(ptr::null_mut(), pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);

let mut result = 0;
let family_match = FcFontMatch(ptr::mut_null(), pattern, &mut result);
let family_match = FcFontMatch(ptr::null_mut(), pattern, &mut result);

let family_name = if result == FcResultMatch {
let mut match_string: *mut FcChar8 = ptr::mut_null();
let mut match_string: *mut FcChar8 = ptr::null_mut();
FcPatternGetString(family_match, FC_FAMILY.as_ptr() as *mut i8, 0, &mut match_string);
let result = string::raw::from_buf(match_string as *const i8 as *const u8);
FcPatternDestroy(family_match);
@@ -138,7 +138,7 @@ impl FontHandleMethods for FontHandle {
let glyphs = [glyph as CGGlyph];
let advance = self.ctfont.get_advances_for_glyphs(kCTFontDefaultOrientation,
&glyphs[0],
ptr::mut_null(),
ptr::null_mut(),
1);
Some(advance as FractionalPixel)
}
@@ -175,9 +175,9 @@ impl Shaper {
// configure static function callbacks.
// NB. This funcs structure could be reused globally, as it never changes.
let hb_funcs: *mut hb_font_funcs_t = hb_font_funcs_create();
hb_font_funcs_set_glyph_func(hb_funcs, glyph_func, ptr::mut_null(), None);
hb_font_funcs_set_glyph_h_advance_func(hb_funcs, glyph_h_advance_func, ptr::mut_null(), None);
hb_font_funcs_set_glyph_h_kerning_func(hb_funcs, glyph_h_kerning_func, ptr::mut_null(), ptr::mut_null());
hb_font_funcs_set_glyph_func(hb_funcs, glyph_func, ptr::null_mut(), None);
hb_font_funcs_set_glyph_h_advance_func(hb_funcs, glyph_h_advance_func, ptr::null_mut(), None);
hb_font_funcs_set_glyph_h_kerning_func(hb_funcs, glyph_h_kerning_func, ptr::null_mut(), ptr::null_mut());
hb_font_set_funcs(hb_font, hb_funcs, font_ptr as *mut c_void, None);

Shaper {
@@ -211,7 +211,7 @@ impl ShaperMethods for Shaper {
0,
text.len() as c_int);

hb_shape(self.hb_font, hb_buffer, ptr::mut_null(), 0);
hb_shape(self.hb_font, hb_buffer, ptr::null_mut(), 0);
self.save_glyph_results(text, glyphs, hb_buffer);
hb_buffer_destroy(hb_buffer);
}
@@ -511,11 +511,11 @@ extern fn get_font_table_func(_: *mut hb_face_t, tag: hb_tag_t, user_data: *mut

// TODO(Issue #197): reuse font table data, which will change the unsound trickery here.
match (*font).get_table_for_tag(tag as FontTableTag) {
None => ptr::mut_null(),
None => ptr::null_mut(),
Some(ref font_table) => {
let skinny_font_table_ptr: *const FontTable = font_table; // private context

let mut blob: *mut hb_blob_t = ptr::mut_null();
let mut blob: *mut hb_blob_t = ptr::null_mut();
(*skinny_font_table_ptr).with_buffer(|buf: *const u8, len: uint| {
// HarfBuzz calls `destroy_blob_func` when the buffer is no longer needed.
blob = hb_blob_create(buf as *const c_char,
@@ -9,7 +9,7 @@

use text::glyph::GlyphStore;

pub use Shaper = text::shaping::harfbuzz::Shaper;
pub use text::shaping::harfbuzz::Shaper;

pub mod harfbuzz;

@@ -977,10 +977,16 @@ impl BlockFlow {
let mut candidate_block_size_iterator = CandidateBSizeIterator::new(
self.fragment.style(),
self.base.block_container_explicit_block_size);
for candidate_block_size in candidate_block_size_iterator {
candidate_block_size_iterator.candidate_value = match candidate_block_size {
Auto => block_size,
Specified(value) => value
// Can't use `for` because we assign to candidate_block_size_iterator.candidate_value
loop {
match candidate_block_size_iterator.next() {
Some(candidate_block_size) => {
candidate_block_size_iterator.candidate_value = match candidate_block_size {
Auto => block_size,
Specified(value) => value
}
}
None => break,
}
}

@@ -1097,10 +1103,16 @@ impl BlockFlow {
let mut candidate_block_size_iterator =
CandidateBSizeIterator::new(self.fragment.style(),
self.base.block_container_explicit_block_size);
for candidate_block_size in candidate_block_size_iterator {
candidate_block_size_iterator.candidate_value = match candidate_block_size {
Auto => content_block_size,
Specified(value) => value,
// Can't use `for` because we assign to candidate_block_size_iterator.candidate_value
loop {
match candidate_block_size_iterator.next() {
Some(candidate_block_size) => {
candidate_block_size_iterator.candidate_value = match candidate_block_size {
Auto => content_block_size,
Specified(value) => value,
}
}
None => break,
}
}

@@ -1241,19 +1253,26 @@ impl BlockFlow {
let mut candidate_block_size_iterator =
CandidateBSizeIterator::new(style, Some(containing_block_block_size));

for block_size_used_val in candidate_block_size_iterator {
solution =
Some(BSizeConstraintSolution::solve_vertical_constraints_abs_nonreplaced(
block_size_used_val,
margin_block_start,
margin_block_end,
block_start,
block_end,
content_block_size,
available_block_size,
static_b_offset));

candidate_block_size_iterator.candidate_value = solution.unwrap().block_size
// Can't use `for` because we assign to candidate_block_size_iterator.candidate_value
loop {
match candidate_block_size_iterator.next() {
Some(block_size_used_val) => {
solution =
Some(BSizeConstraintSolution::solve_vertical_constraints_abs_nonreplaced(
block_size_used_val,
margin_block_start,
margin_block_end,
block_start,
block_end,
content_block_size,
available_block_size,
static_b_offset));

candidate_block_size_iterator.candidate_value
= solution.unwrap().block_size;
}
None => break,
}
}
}
}
@@ -1773,7 +1792,7 @@ impl Flow for BlockFlow {
// FIXME(#2010, pcwalton): This is a hack and is totally bogus in the presence of pseudo-
// elements. But until we have incremental reflow we can't do better--we recreate the flow
// for every DOM node so otherwise we nuke layers on every reflow.
LayerId(self.fragment.node.id(), fragment_index)
LayerId(self.fragment.node.id() as uint, fragment_index)
}

fn is_absolute_containing_block(&self) -> bool {

0 comments on commit a640a7c

Please sign in to comment.
You can’t perform that action at this time.