servo: Fix upstream build breaks from reinterpret_cast
authorBrian J. Burg <burg@cs.washington.edu>
Wed, 05 Sep 2012 12:10:26 -0700
changeset 361871 bd25376933e4ea18a5d4049bdd582c1bdb37aa56
parent 361870 bcb200926d64b3388c2fa93eb55f5b632523130d
child 361872 b65c3103aef0569b31e5f0711cdf054e58bdd679
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
servo: Fix upstream build breaks from reinterpret_cast Source-Repo: https://github.com/servo/servo Source-Revision: 1b54eacbe130aaa3ff65a07e3e391c851c9a3e64
servo/src/servo/content/content_task.rs
servo/src/servo/dom/bindings/document.rs
servo/src/servo/dom/bindings/element.rs
servo/src/servo/dom/bindings/node.rs
servo/src/servo/dom/bindings/utils.rs
servo/src/servo/dom/bindings/window.rs
servo/src/servo/dom/rcu.rs
servo/src/servo/engine.rs
servo/src/servo/layout/base.rs
servo/src/servo/layout/inline.rs
servo/src/servo/layout/layout_task.rs
servo/src/servo/layout/style/apply.rs
servo/src/servo/layout/traverse.rs
servo/src/servo/parser/css_lexer.rs
servo/src/servo/parser/html_builder.rs
servo/src/servo/parser/html_lexer.rs
servo/src/servo/parser/hubbub_html_parser.rs
servo/src/servo/resource/file_loader.rs
servo/src/servo/resource/http_loader.rs
servo/src/servo/resource/image_cache_task.rs
servo/src/servo/resource/resource_task.rs
servo/src/servo/util/color.rs
servo/src/servo/util/url.rs
--- a/servo/src/servo/content/content_task.rs
+++ b/servo/src/servo/content/content_task.rs
@@ -29,30 +29,30 @@ import js::global::{global_class, debug_
 import either::{Either, Left, Right};
 
 import dom::bindings::utils::rust_box;
 import js::rust::compartment;
 
 import resource::resource_task;
 import resource_task::{ResourceTask};
 
-import std::net::url::url;
+import std::net::url::Url;
 import url_to_str = std::net::url::to_str;
 import util::url::make_url;
 import task::{task, SingleThreaded};
 
 import js::glue::bindgen::RUST_JSVAL_TO_OBJECT;
 import js::JSVAL_NULL;
 import js::jsapi::jsval;
 import js::jsapi::bindgen::JS_CallFunctionValue;
 import ptr::null;
 
 enum ControlMsg {
-    ParseMsg(url),
-    ExecuteMsg(url),
+    ParseMsg(Url),
+    ExecuteMsg(Url),
     Timer(~dom::bindings::window::TimerData),
     ExitMsg
 }
 
 enum PingMsg {
     PongMsg
 }
 
@@ -84,17 +84,17 @@ struct Content<C:Compositor> {
     let event_port: comm::Port<Event>;
 
     let scope: NodeScope;
     let jsrt: jsrt;
     let cx: cx;
 
     let mut document: Option<@Document>;
     let mut window:   Option<@Window>;
-    let mut doc_url: Option<url>;
+    let mut doc_url: Option<Url>;
 
     let resource_task: ResourceTask;
 
     let compartment: Option<compartment>;
 
     new(layout_task: LayoutTask, +compositor: C, from_master: Port<ControlMsg>,
         resource_task: ResourceTask) {
         self.layout_task = layout_task;
@@ -216,17 +216,17 @@ struct Content<C:Compositor> {
 
           ExitMsg => {
             self.layout_task.send(layout_task::ExitMsg);
             return false;
           }
         }
     }
 
-    fn relayout(document: Document, doc_url: &url) {
+    fn relayout(document: Document, doc_url: &Url) {
         #debug("content: performing relayout");
 
         // Now, join the layout so that they will see the latest
         // changes we have made.
         join_layout(self.scope, self.layout_task);
 
         // Send new document and relevant styles to layout
         // FIXME: Put CSS rules in an arc or something.
--- a/servo/src/servo/dom/bindings/document.rs
+++ b/servo/src/servo/dom/bindings/document.rs
@@ -56,39 +56,39 @@ enum Element = int;
         let uri = (*unwrap(JS_THIS_OBJECT(cx, vp))).payload.getDocumentURI();
         JS_SET_RVAL(cx, vp, domstring_to_jsval(cx, uri));
     }
     return 1;
 }*/
 
 extern fn getDocumentElement(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
     -> JSBool unsafe {
-    let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(vp));
+    let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
     if obj.is_null() {
         return 0;
     }
 
     let box = unwrap(obj);
     let node = (*box).payload.root;
     let scope = (*box).payload.scope;
     *vp = RUST_OBJECT_TO_JSVAL(node::create(cx, node, scope).ptr);
     return 1;
 }
 
 unsafe fn unwrap(obj: *JSObject) -> *rust_box<Document> {
     //TODO: some kind of check if this is a Document object
     let val = JS_GetReservedSlot(obj, 0);
-    unsafe::reinterpret_cast(RUST_JSVAL_TO_PRIVATE(val))
+    unsafe::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val))
 }
 
 extern fn finalize(_fop: *JSFreeOp, obj: *JSObject) {
     #debug("document finalize!");
     unsafe {
         let val = JS_GetReservedSlot(obj, 0);
-        let _doc: @Document = unsafe::reinterpret_cast(RUST_JSVAL_TO_PRIVATE(val));
+        let _doc: @Document = unsafe::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val));
     }
 }
 
 fn init(compartment: bare_compartment, doc: @Document) {
     let obj = utils::define_empty_prototype(~"Document", None, compartment);
 
     let attrs = @~[
         {name: compartment.add_name(~"documentElement"),
@@ -103,17 +103,17 @@ fn init(compartment: bare_compartment, d
 
     compartment.register_class(utils::instance_jsclass(~"DocumentInstance", finalize));
 
     let instance = result::unwrap(
         compartment.new_object_with_proto(~"DocumentInstance", ~"Document",
                                           compartment.global_obj.ptr));
 
     unsafe {
-        let raw_ptr: *libc::c_void = unsafe::reinterpret_cast(squirrel_away(doc));
+        let raw_ptr: *libc::c_void = unsafe::reinterpret_cast(&squirrel_away(doc));
         JS_SetReservedSlot(instance.ptr, 0, RUST_PRIVATE_TO_JSVAL(raw_ptr));
     }
 
     compartment.define_property(~"document", RUST_OBJECT_TO_JSVAL(instance.ptr),
                                 GetJSClassHookStubPointer(PROPERTY_STUB) as *u8,
                                 GetJSClassHookStubPointer(STRICT_PROPERTY_STUB) as *u8,
                                 JSPROP_ENUMERATE);
 }
--- a/servo/src/servo/dom/bindings/element.rs
+++ b/servo/src/servo/dom/bindings/element.rs
@@ -18,17 +18,17 @@ import node::unwrap;
 import dom::base::{HTMLImageElement, HTMLScriptElement, HTMLHeadElement, HTMLDivElement,
                    UnknownElement};
 import gfx::geometry::{au_to_px, px_to_au};
 
 extern fn finalize(_fop: *JSFreeOp, obj: *JSObject) {
     #debug("element finalize!");
     unsafe {
         let val = JS_GetReservedSlot(obj, 0);
-        let _node: ~NodeBundle = unsafe::reinterpret_cast(RUST_JSVAL_TO_PRIVATE(val));
+        let _node: ~NodeBundle = unsafe::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val));
     }
 }
 
 fn init(compartment: bare_compartment) {
     let obj = utils::define_empty_prototype(~"Element", Some(~"Node"), compartment);
     let attrs = @~[
         {name: compartment.add_name(~"tagName"),
          tinyid: 0,
@@ -58,17 +58,17 @@ fn init(compartment: bare_compartment) {
     vec::push(compartment.global_props, attrs);
     vec::as_buf(*attrs, |specs, _len| {
         JS_DefineProperties(compartment.cx.ptr, obj.ptr, specs);
     });
 }
 
 extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
     -> JSBool unsafe {
-    let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(vp));
+    let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
     if obj.is_null() {
         return 0;
     }
 
     let bundle = unwrap(obj);
     let width = (*bundle).payload.scope.write((*bundle).payload.node, |nd| {
         match nd.kind {
           ~Element(ed) => {
@@ -82,17 +82,17 @@ extern fn HTMLImageElement_getWidth(cx: 
     });
     *vp = RUST_INT_TO_JSVAL(
               (au_to_px(width) & (i32::max_value as int)) as libc::c_int);
     return 1;
 }
 
 extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
     -> JSBool unsafe {
-    let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(vp));
+    let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
     if obj.is_null() {
         return 0;
     }
 
     let bundle = unwrap(obj);
     do (*bundle).payload.scope.write((*bundle).payload.node) |nd| {
         match nd.kind {
           ~Element(ed) => {
@@ -106,17 +106,17 @@ extern fn HTMLImageElement_setWidth(cx: 
         }
     };
     return 1;
 }
 
 extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
     -> JSBool {
     unsafe {
-        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(vp));
+        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
         if obj.is_null() {
             return 0;
         }
 
         let bundle = unwrap(obj);
         do (*bundle).payload.scope.write((*bundle).payload.node) |nd| {
             match nd.kind {
               ~Element(ed) => {
@@ -153,13 +153,13 @@ fn create(cx: *JSContext, node: Node, sc
     //TODO error checking
     let compartment = utils::get_compartment(cx);
     let obj = result::unwrap(
         (*compartment).new_object_with_proto(~"GenericElementInstance", proto,
                                              (*compartment).global_obj.ptr));
  
     unsafe {
         let raw_ptr: *libc::c_void =
-            unsafe::reinterpret_cast(squirrel_away_unique(~NodeBundle(node, scope)));
+            unsafe::reinterpret_cast(&squirrel_away_unique(~NodeBundle(node, scope)));
         JS_SetReservedSlot(obj.ptr, 0, RUST_PRIVATE_TO_JSVAL(raw_ptr));
     }
     return obj;
 }
--- a/servo/src/servo/dom/bindings/node.rs
+++ b/servo/src/servo/dom/bindings/node.rs
@@ -62,22 +62,22 @@ struct NodeBundle {
     new(n: Node, s: NodeScope) {
         self.node = n;
         self.scope = s;
     }
 }
 
 unsafe fn unwrap(obj: *JSObject) -> *rust_box<NodeBundle> {
     let val = JS_GetReservedSlot(obj, 0);
-    unsafe::reinterpret_cast(RUST_JSVAL_TO_PRIVATE(val))
+    unsafe::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val))
 }
 
 extern fn getFirstChild(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
     unsafe {
-        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(vp));
+        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
         if obj.is_null() {
             return 0;
         }
 
         let bundle = unwrap(obj);
         do (*bundle).payload.scope.write((*bundle).payload.node) |nd| {
             match nd.tree.first_child {
               Some(n) => {
@@ -90,17 +90,17 @@ extern fn getFirstChild(cx: *JSContext, 
             }
         };
     }
     return 1;
 }
 
 extern fn getNextSibling(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
     unsafe {
-        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(vp));
+        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
         if obj.is_null() {
             return 0;
         }
 
         let bundle = unwrap(obj);
         do (*bundle).payload.scope.write((*bundle).payload.node) |nd| {
             match nd.tree.next_sibling {
               Some(n) => {
@@ -113,17 +113,17 @@ extern fn getNextSibling(cx: *JSContext,
             }
         };
     }
     return 1;
 }
 
 extern fn getNodeType(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
     unsafe {
-        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(vp));
+        let obj = JS_THIS_OBJECT(cx, unsafe::reinterpret_cast(&vp));
         if obj.is_null() {
             return 0;
         }
 
         let bundle = unwrap(obj);
         let nodeType = do (*bundle).payload.node.read |nd| {
             match nd.kind {
               ~Element(*) => 1,
--- a/servo/src/servo/dom/bindings/utils.rs
+++ b/servo/src/servo/dom/bindings/utils.rs
@@ -58,27 +58,27 @@ fn jsval_to_str(cx: *JSContext, v: jsval
 
 unsafe fn domstring_to_jsval(cx: *JSContext, str: DOMString) -> jsval {
     match str {
       null_string => {
         JSVAL_NULL
       }
       str(s) => {
         str::as_buf(s, |buf, len| {
-            let cbuf = unsafe::reinterpret_cast(buf);
+            let cbuf = unsafe::reinterpret_cast(&buf);
             RUST_STRING_TO_JSVAL(JS_NewStringCopyN(cx, cbuf, len as libc::size_t))
         })
       }
     }
 }
 
 fn get_compartment(cx: *JSContext) -> *bare_compartment {
     unsafe {
         let priv: *libc::c_void = JS_GetContextPrivate(cx);
-        let compartment: *bare_compartment = unsafe::reinterpret_cast(priv);
+        let compartment: *bare_compartment = unsafe::reinterpret_cast(&priv);
         assert cx == (*compartment).cx.ptr;
         compartment
     }
 }
 
 extern fn has_instance(_cx: *JSContext, obj: *JSObject, v: *jsval, bp: *mut JSBool) -> JSBool {
     //XXXjdm this is totally broken for non-object values
     let mut o = RUST_JSVAL_TO_OBJECT(unsafe {*v});
--- a/servo/src/servo/dom/bindings/window.rs
+++ b/servo/src/servo/dom/bindings/window.rs
@@ -60,24 +60,24 @@ extern fn setTimeout(cx: *JSContext, arg
                              base::Fire(~TimerData(argc, argv)));
 
     JS_SET_RVAL(cx, vp, JSVAL_NULL);
     return 1;
 }
 
 unsafe fn unwrap(obj: *JSObject) -> *rust_box<Window> {
     let val = JS_GetReservedSlot(obj, 0);
-    unsafe::reinterpret_cast(RUST_JSVAL_TO_PRIVATE(val))
+    unsafe::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val))
 }
 
 extern fn finalize(_fop: *JSFreeOp, obj: *JSObject) {
     #debug("finalize!");
     unsafe {
         let val = JS_GetReservedSlot(obj, 0);
-        let _: @Window = unsafe::reinterpret_cast(RUST_JSVAL_TO_PRIVATE(val));
+        let _: @Window = unsafe::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val));
     }
 }
 
 fn init(compartment: bare_compartment, win: @Window) {
     let proto = utils::define_empty_prototype(~"Window", None, compartment);
     compartment.register_class(utils::instance_jsclass(~"WindowInstance", finalize));
 
     let obj = result::unwrap(
@@ -96,17 +96,17 @@ fn init(compartment: bare_compartment, w
                      flags: 0,
                      selfHostedName: null()}];
 
     vec::as_buf(methods, |fns, _len| {
         JS_DefineFunctions(compartment.cx.ptr, proto.ptr, fns);
     });
 
     unsafe {
-        let raw_ptr: *libc::c_void = unsafe::reinterpret_cast(squirrel_away(win));
+        let raw_ptr: *libc::c_void = unsafe::reinterpret_cast(&squirrel_away(win));
         JS_SetReservedSlot(obj.ptr, 0, RUST_PRIVATE_TO_JSVAL(raw_ptr));
     }
 
     //TODO: All properties/methods on Window need to be available on the global
     //      object as well. We probably want a special JSClass with a resolve hook.
     compartment.define_property(~"window", RUST_OBJECT_TO_JSVAL(obj.ptr),
                                 JS_PropertyStub, JS_StrictPropertyStub,
                                 JSPROP_ENUMERATE);
--- a/servo/src/servo/dom/rcu.rs
+++ b/servo/src/servo/dom/rcu.rs
@@ -125,36 +125,36 @@ impl<T:send,A> Handle<T,A> {
         f(*self.read_aux())
     }
 }
 
 // Private methods
 impl<T: copy send,A> Scope<T,A> {
     fn clone(v: *T) -> *T unsafe {
         let n: *mut T =
-            unsafe::reinterpret_cast(libc::calloc(sys::size_of::<T>() as size_t, 1u as size_t));
+            unsafe::reinterpret_cast(&libc::calloc(sys::size_of::<T>() as size_t, 1u as size_t));
 
         // n.b.: this assignment will run the drop glue for <T,A>. *Hopefully* the fact that
         // everything is initialized to NULL by calloc will make this ok.  We may have to make the
         // take glue be tolerant of this.
         *n = unsafe{*v};
 
-        return unsafe::reinterpret_cast(n);
+        return unsafe::reinterpret_cast(&n);
     }
 }
 
 unsafe fn free<T:send>(t: *T) {
-    let _x <- *unsafe::reinterpret_cast::<*T,*mut T>(t);
-    libc::free(unsafe::reinterpret_cast(t));
+    let _x <- *unsafe::reinterpret_cast::<*T,*mut T>(&t);
+    libc::free(unsafe::reinterpret_cast(&t));
 }
 
 unsafe fn free_handle<T:send,A>(h: Handle<T,A>) {
     free(h.read_ptr());
-    if h.write_ptr() != unsafe::reinterpret_cast(h.read_ptr()) {
-        free(unsafe::reinterpret_cast::<*mut T,*T>(h.write_ptr()));
+    if h.write_ptr() != unsafe::reinterpret_cast(&h.read_ptr()) {
+        free(unsafe::reinterpret_cast::<*mut T,*T>(&h.write_ptr()));
     }
 }
 
 fn null_handle<T:send,A>() -> Handle<T,A> {
     _Handle(ptr::null())
 }
 
 fn Scope<T:send,A>() -> Scope<T,A> {
@@ -178,17 +178,17 @@ impl<T:copy send,A> Scope<T,A> {
     fn reader_joined() unsafe {
         assert self.d.layout_active;
 
         if self.d.first_dirty.is_not_null() {
             let mut handle = self.d.first_dirty;
             while (*handle).is_not_null() {
                 free(handle.read_ptr());
 
-                handle.set_read_ptr(unsafe::reinterpret_cast(handle.write_ptr()));
+                handle.set_read_ptr(unsafe::reinterpret_cast(&handle.write_ptr()));
                 let next_handle = handle.next_dirty();
                 handle.set_next_dirty(null_handle());
                 handle = next_handle;
             }
             self.d.first_dirty = null_handle();
         }
 
         assert self.d.first_dirty.is_null();
@@ -200,30 +200,30 @@ impl<T:copy send,A> Scope<T,A> {
         f(*h.write_ptr())
     }
 
     fn write<U>(h: Handle<T,A>, f: fn(T) -> U) -> U unsafe {
         let const_read_ptr = ptr::const_offset(h.read_ptr(), 0);
         let const_write_ptr = ptr::const_offset(h.write_ptr(), 0);
         if self.d.layout_active && const_read_ptr == const_write_ptr {
             #debug["marking handle %? as dirty", h];
-            h.set_write_ptr(unsafe::reinterpret_cast(self.clone(h.read_ptr())));
+            h.set_write_ptr(unsafe::reinterpret_cast(&self.clone(h.read_ptr())));
             h.set_next_dirty(self.d.first_dirty);
             self.d.first_dirty = h;
         }
         f(*h.write_ptr())
     }
 
     #[allow(non_implicitly_copyable_typarams)]
     fn handle(v: T) -> Handle<T,A> unsafe {
         let d: *HandleData<T,A> =
             unsafe::reinterpret_cast(
-                libc::malloc(sys::size_of::<HandleData<T,A>>() as size_t));
+                &libc::malloc(sys::size_of::<HandleData<T,A>>() as size_t));
         (*d).read_ptr = self.clone(ptr::addr_of(v));
-        (*d).write_ptr = unsafe::reinterpret_cast((*d).read_ptr);
+        (*d).write_ptr = unsafe::reinterpret_cast(&(*d).read_ptr);
         (*d).read_aux = ptr::null();
         (*d).next_dirty = null_handle();
         let h = _Handle(d);
         push(self.d.free_list, h);
         return h;
     }
 }
 
--- a/servo/src/servo/engine.rs
+++ b/servo/src/servo/engine.rs
@@ -5,17 +5,17 @@ import gfx::render_task;
 import render_task::RenderTask;
 import pipes::{spawn_service, select};
 import layout::layout_task;
 import layout_task::LayoutTask;
 import content::content_task;
 import content_task::{ContentTask};
 import resource::resource_task;
 import resource::resource_task::{ResourceTask};
-import std::net::url::url;
+import std::net::url::Url;
 import resource::image_cache_task;
 import image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
 
 import pipes::{Port, Chan};
 
 fn macros() {
     include!("macros.rs");
 }
@@ -96,17 +96,17 @@ impl<C: Compositor> Engine<C> {
                 }
             )
         }
     }
 }
 
 proto! EngineProto(
     Running:send {
-        LoadURL(url) -> Running,
+        LoadURL(Url) -> Running,
         Exit -> Exiting
     }
 
     Exiting:recv {
         Exited -> !
     }
 )
 
--- a/servo/src/servo/layout/base.rs
+++ b/servo/src/servo/layout/base.rs
@@ -11,17 +11,17 @@ import geom::rect::Rect;
 import geom::size::Size2D;
 import image::base::Image;
 import util::tree;
 import util::color::Color;
 import text::TextBox;
 import traverse::extended_full_traversal;
 import style::style::{SpecifiedStyle};
 import vec::{push, push_all};
-import std::net::url::url;
+import std::net::url::Url;
 import resource::image_cache_task;
 import image_cache_task::ImageCacheTask;
 import core::to_str::ToStr;
 import std::arc::{ARC, clone};
 import task::spawn;
 
 enum BoxKind {
     BlockBox,
@@ -89,22 +89,22 @@ struct Box {
 }
 
 #[doc="A struct to store image data.  The image will be loaded once,
  the first time it is requested, and an arc will be stored.  Clones of
  this arc are given out on demand."]
 struct ImageHolder {
     // Invariant: at least one of url and image is not none, except
     // occasionally while get_image is being called
-    let mut url : Option<url>;
+    let mut url : Option<Url>;
     let mut image : Option<ARC<~Image>>;
     let image_cache_task: ImageCacheTask;
     let reflow: fn~();
 
-    new(-url : url, image_cache_task: ImageCacheTask, reflow: fn~()) {
+    new(-url : Url, image_cache_task: ImageCacheTask, reflow: fn~()) {
         self.url = Some(copy url);
         self.image = None;
         self.image_cache_task = image_cache_task;
         self.reflow = copy reflow;
 
         // Tell the image cache we're going to be interested in this url
         // FIXME: These two messages must be sent to prep an image for use
         // but they are intended to be spread out in time. Ideally prefetch
--- a/servo/src/servo/layout/inline.rs
+++ b/servo/src/servo/layout/inline.rs
@@ -25,28 +25,28 @@ impl @Box : InlineLayout {
         let y = 0;
         let mut x = 0;
         let mut current_height = 0;
 
         // loop over children and set them at the proper horizontal offset
         for tree::each_child(BTree, self) |kid| {
             kid.bounds.origin = Point2D(au(x), au(y));
             x += *kid.bounds.size.width;
-            current_height = i32::max(&current_height, &*kid.bounds.size.height);
+            current_height = i32::max(current_height, *kid.bounds.size.height);
         }
 
         let height = match self.appearance.height { 
             Px(p) => px_to_au(p.to_int()),
             Auto => au(current_height),
             _ => fail ~"inhereit_height failed, height is neither a Px or auto"
         };
 
         let width = match self.appearance.width { 
             Px(p) => px_to_au(p.to_int()),
-            Auto => au(i32::max(&x, &*self.bounds.size.width)),
+            Auto => au(i32::max(x, *self.bounds.size.width)),
             _ => fail ~"inhereit_width failed, width is neither a Px or auto"
         };
 
         // The maximum available width should have been set in the top-down pass
         self.bounds.size = Size2D(width, height);
 
         #debug["reflow_inline size=%?", copy self.bounds];
     }
--- a/servo/src/servo/layout/layout_task.rs
+++ b/servo/src/servo/layout/layout_task.rs
@@ -6,28 +6,28 @@
 import std::arc::ARC;
 import display_list_builder::build_display_list;
 import dom::base::Node;
 import dom::style::Stylesheet;
 import gfx::geometry::px_to_au;
 import gfx::render_task;
 import render_task::RenderTask;
 import resource::image_cache_task::ImageCacheTask;
-import std::net::url::url;
+import std::net::url::Url;
 import style::apply::apply_style;
 import dom::event::{Event, ReflowEvent};
 import content::content_task;
 
 import task::*;
 import comm::*;
 
 type LayoutTask = Chan<Msg>;
 
 enum Msg {
-    BuildMsg(Node, ARC<Stylesheet>, url, Chan<Event>),
+    BuildMsg(Node, ARC<Stylesheet>, Url, Chan<Event>),
     PingMsg(Chan<content_task::PingMsg>),
     ExitMsg
 }
 
 fn LayoutTask(render_task: RenderTask, image_cache_task: ImageCacheTask) -> LayoutTask {
     do spawn_listener::<Msg>|request| {
 
         // This just keeps our dom aux objects alive
--- a/servo/src/servo/layout/style/apply.rs
+++ b/servo/src/servo/layout/style/apply.rs
@@ -1,40 +1,40 @@
 #[doc="Applies the appropriate CSS style to boxes."]
 
 import dom::base::{Element, HTMLImageElement, Node};
 import dom::style::{Percent, Mm, Pt, Px, Auto, PtToPx, MmToPx};
 import gfx::geometry::au_to_px;
 import base::{Box, BTree, NTree, LayoutData, SpecifiedStyle, ImageHolder,
               BlockBox, InlineBox, IntrinsicBox, TextBox};
 import traverse::{top_down_traversal};
-import std::net::url::url;
+import std::net::url::Url;
 import resource::image_cache_task::ImageCacheTask;
 
 struct StyleApplicator {
     box: @Box;
-    doc_url: &url;
+    doc_url: &Url;
     image_cache_task: ImageCacheTask;
     reflow: fn~();
 }
 
-fn apply_style(box: @Box, doc_url: &url, image_cache_task: ImageCacheTask, reflow: fn~()) {
+fn apply_style(box: @Box, doc_url: &Url, image_cache_task: ImageCacheTask, reflow: fn~()) {
     let applicator = StyleApplicator {
         box: box,
         doc_url: doc_url,
         image_cache_task: image_cache_task,
         reflow: reflow
     };
 
     applicator.apply_css_style();
 }
 
 #[doc="A wrapper around a set of functions that can be applied as a top-down traversal of layout
        boxes."]
-fn inheritance_wrapper(box : @Box, doc_url: &url, image_cache_task: ImageCacheTask, reflow: fn~()) {
+fn inheritance_wrapper(box : @Box, doc_url: &Url, image_cache_task: ImageCacheTask, reflow: fn~()) {
     let applicator = StyleApplicator {
         box: box,
         doc_url: doc_url,
         image_cache_task: image_cache_task,
         reflow: reflow
     };
     applicator.apply_style();
     inhereit_height(box);
--- a/servo/src/servo/layout/traverse.rs
+++ b/servo/src/servo/layout/traverse.rs
@@ -1,12 +1,12 @@
 #[doc = "Interface for running tree-based traversals over layout boxes"]
 
 import base::{Box, BTree, NodeMethods};
-import intrinsic::tydesc;
+import intrinsic::TyDesc;
 
 export full_traversal;
 export top_down_traversal;
 export bottom_up_traversal;
 export extended_full_traversal;
 export extended_top_down_traversal;
 
 // The underlying representation of an @T.  We don't actually care
--- a/servo/src/servo/parser/css_lexer.rs
+++ b/servo/src/servo/parser/css_lexer.rs
@@ -4,17 +4,17 @@ import dom::style;
 import option::is_none;
 import str::from_bytes;
 import vec::push;
 
 import pipes::{Port, Chan};
 
 import lexer_util::*;
 
-import std::net::url::url;
+import std::net::url::Url;
 import resource::resource_task::{ResourceTask, ProgressMsg, Load};
 
 enum ParserState {
     CssElement,
     CssRelation,
     CssDescription,
     CssAttribute
 }
@@ -263,17 +263,17 @@ fn spawn_css_lexer_from_string(-content 
 
         lex_css_from_bytes(input_port, result_chan);
     }
 
     return result_port;
 }
 
 #[allow(non_implicitly_copyable_typarams)]
-fn spawn_css_lexer_task(-url: url, resource_task: ResourceTask) -> pipes::Port<Token> {
+fn spawn_css_lexer_task(-url: Url, resource_task: ResourceTask) -> pipes::Port<Token> {
     let (result_chan, result_port) = pipes::stream();
 
     do task::spawn || {
         assert url.path.ends_with(".css");
         let input_port = Port();
         // TODO: change copy to move once the compiler permits it
         resource_task.send(Load(copy url, input_port.chan()));
 
--- a/servo/src/servo/parser/html_builder.rs
+++ b/servo/src/servo/parser/html_builder.rs
@@ -5,27 +5,27 @@ import dom::base::{Attr, Element, Elemen
 import dom::base::{HTMLImageElement, Node, NodeScope, Text, UnknownElement};
 import geom::size::Size2D;
 import gfx::geometry;
 import gfx::geometry::au;
 import parser = parser::html_lexer;
 import parser::Token;
 import dom::style::Stylesheet;
 import vec::{push, push_all_move, flat_map};
-import std::net::url::url;
+import std::net::url::Url;
 import resource::resource_task::{ResourceTask, Load, Payload, Done};
 import to_str::ToStr;
 
 enum CSSMessage {
-    File(url),
+    File(Url),
     Exit   
 }
 
 enum js_message {
-    js_file(url),
+    js_file(Url),
     js_exit
 }
 
 #[allow(non_implicitly_copyable_typarams)]
 fn link_up_attribute(scope: NodeScope, node: Node, -key: ~str, -value: ~str) {
     // TODO: Implement atoms so that we don't always perform string comparisons.
     scope.read(node, |node_contents| {
         match *node_contents.kind {
@@ -163,17 +163,17 @@ fn js_script_listener(to_parent : comm::
         }
     }
 
     let js_scripts = vec::map(result_vec, |result_port| result_port.recv());
     to_parent.send(js_scripts);
 }
 
 #[allow(non_implicitly_copyable_typarams)]
-fn build_dom(scope: NodeScope, stream: comm::Port<Token>, url: url,
+fn build_dom(scope: NodeScope, stream: comm::Port<Token>, url: Url,
              resource_task: ResourceTask) -> (Node, comm::Port<Stylesheet>, comm::Port<~[~[u8]]>) {
     // The current reference node.
     let mut cur_node = scope.new_node(Element(ElementData(~"html", ~HTMLDivElement)));
     // We will spawn a separate task to parse any css that is
     // encountered, each link to a stylesheet is sent to the waiting
     // task.  After the html sheet has been fully read, the spawned
     // task will collect the results of all linked style data and send
     // it along the returned port.
--- a/servo/src/servo/parser/html_lexer.rs
+++ b/servo/src/servo/parser/html_lexer.rs
@@ -1,17 +1,17 @@
 import comm::{Port, Chan};
 import dom::style;
 import option::is_none;
 import str::from_bytes;
 import vec::push;
 import lexer_util::*;
 import resource::resource_task;
 import resource_task::{ResourceTask, ProgressMsg, Load};
-import std::net::url::url;
+import std::net::url::Url;
 
 enum Token {
     StartOpeningTag(~str),
     EndOpeningTag,
     EndTag(~str),
     SelfCloseTag,
     Text(~str),
     Attr(~str, ~str),
@@ -219,17 +219,17 @@ fn lexer(+input_port: Port<resource_task
                input_port: input_port,
                mut eof: false
            },
            mut parser_state: state
     };
 }
 
 #[allow(non_implicitly_copyable_typarams)]
-fn spawn_html_lexer_task(-url: url, resource_task: ResourceTask) -> Port<Token> {
+fn spawn_html_lexer_task(-url: Url, resource_task: ResourceTask) -> Port<Token> {
     let html_port = Port();
     let html_chan = Chan(html_port);
 
     task::spawn(|| {
         let input_port = Port();
         // TODO: change copy to move once we can move into closures
         resource_task.send(Load(copy url, input_port.chan()));
         
--- a/servo/src/servo/parser/hubbub_html_parser.rs
+++ b/servo/src/servo/parser/hubbub_html_parser.rs
@@ -9,17 +9,17 @@ use CSSExitMessage = parser::html_builde
 use CSSFileMessage = parser::html_builder::File;
 use JSExitMessage = parser::html_builder::js_exit;
 use JSFileMessage = parser::html_builder::js_file;
 use JSMessage = parser::html_builder::js_message;
 
 use comm::{Chan, Port};
 use str::from_slice;
 use unsafe::reinterpret_cast;
-use Url = std::net::url::url;
+use std::net::url::Url;
 
 type JSResult = ~[~[u8]];
 
 struct HtmlParserResult {
     root: Node;
     style_port: comm::Port<Stylesheet>;
     js_port: comm::Port<JSResult>;
 }
@@ -144,27 +144,27 @@ fn parse_html(scope: NodeScope, url: Url
 
     let (scope, url) = (@copy scope, @copy url);
 
     // Build the root node.
     let root = scope.new_node(Element(ElementData(~"html", ~HTMLDivElement)));
     debug!("created new node");
     let parser = hubbub::Parser("UTF-8", false);
     debug!("created parser");
-    parser.set_document_node(reinterpret_cast(root));
+    parser.set_document_node(reinterpret_cast(&root));
     parser.enable_scripting(true);
     parser.set_tree_handler(@hubbub::TreeHandler {
         create_comment: |_data| {
             debug!("create comment");
             0u  // FIXME: causes segfaults
         },
         create_doctype: |_doctype| {
             debug!("create doctype");
             let new_node = scope.new_node(Element(ElementData(~"doctype", ~UnknownElement)));
-            unsafe { reinterpret_cast(new_node) }
+            unsafe { reinterpret_cast(&new_node) }
         },
         create_element: |tag| {
             debug!("create element");
             let element_kind = build_element_kind(tag.name);
             let node = scope.new_node(Element(ElementData(from_slice(tag.name), element_kind)));
             for tag.attributes.each |attribute| {
                 do scope.read(node) |node_contents| {
                     match *node_contents.kind {
@@ -205,28 +205,28 @@ fn parse_html(scope: NodeScope, url: Url
                             }
                             _ => {}
                         }
                     }
                     _ => {}
                 }
             }
 
-            unsafe { reinterpret_cast(node) }
+            unsafe { reinterpret_cast(&node) }
         },
         create_text: |data| {
             debug!("create text");
             let new_node = scope.new_node(Text(from_slice(data)));
-            unsafe { reinterpret_cast(new_node) }
+            unsafe { reinterpret_cast(&new_node) }
         },
         ref_node: |_node| {},
         unref_node: |_node| {},
         append_child: |parent, child| unsafe {
             debug!("append child");
-            scope.add_child(reinterpret_cast(parent), reinterpret_cast(child));
+            scope.add_child(reinterpret_cast(&parent), reinterpret_cast(&child));
             child
         },
         insert_before: |_parent, _child| {
             debug!("insert before");
             0u
         },
         remove_child: |_parent, _child| {
             debug!("remove child");
@@ -256,17 +256,17 @@ fn parse_html(scope: NodeScope, url: Url
         },
         set_quirks_mode: |_mode| {
             debug!("set quirks mode");
         },
         encoding_change: |_encname| {
             debug!("encoding change");
         },
         complete_script: |script| unsafe {
-            do scope.read(reinterpret_cast(script)) |node_contents| {
+            do scope.read(reinterpret_cast(&script)) |node_contents| {
                 match *node_contents.kind {
                     Element(element) if element.tag_name == ~"script" => {
                         match element.get_attr(~"src") {
                             Some(src) => {
                                 debug!("found script: %s", src);
                                 let new_url = make_url(src, Some(copy *url));
                                 js_chan.send(JSFileMessage(new_url));
                             }
--- a/servo/src/servo/resource/file_loader.rs
+++ b/servo/src/servo/resource/file_loader.rs
@@ -1,19 +1,19 @@
 export factory;
 
 import comm::Chan;
 import task::spawn;
 import resource_task::{ProgressMsg, Payload, Done};
-import std::net::url::url;
+import std::net::url::Url;
 import io::{file_reader, ReaderUtil};
 
 const READ_SIZE: uint = 1024;
 
-fn factory(+url: url, progress_chan: Chan<ProgressMsg>) {
+fn factory(+url: Url, progress_chan: Chan<ProgressMsg>) {
     assert url.scheme == ~"file";
 
     do spawn {
         match file_reader(&Path(url.path)) {
           Ok(reader) => {
             while !reader.eof() {
                 let data = reader.read_bytes(READ_SIZE);
                 progress_chan.send(Payload(data));
--- a/servo/src/servo/resource/http_loader.rs
+++ b/servo/src/servo/resource/http_loader.rs
@@ -1,17 +1,17 @@
 export factory;
 
 import comm::Chan;
 import task::spawn;
 import resource_task::{ProgressMsg, Payload, Done};
-import std::net::url::url;
+import std::net::url::Url;
 import http_client::{uv_http_request};
 
-fn factory(+url: url, progress_chan: Chan<ProgressMsg>) {
+fn factory(+url: Url, progress_chan: Chan<ProgressMsg>) {
     assert url.scheme == ~"http";
 
     do spawn {
         let url = copy url;
 
         #debug("http_loader: requesting via http: %?", copy url);
         let request = uv_http_request(copy url);
         let errored = @mut false;
--- a/servo/src/servo/resource/image_cache_task.rs
+++ b/servo/src/servo/resource/image_cache_task.rs
@@ -1,46 +1,46 @@
 export Msg, Prefetch, Decode, GetImage, WaitForImage, Exit;
 export ImageResponseMsg, ImageReady, ImageNotReady, ImageFailed;
 export ImageCacheTask;
 export ImageCacheTaskClient;
 export SyncImageCacheTask;
 
 import image::base::{Image, load_from_memory, test_image_bin};
-import std::net::url::url;
+import std::net::url::Url;
 import util::url::{make_url, UrlMap, url_map};
 import comm::{Chan, Port};
 import task::{spawn, spawn_listener};
 import resource::resource_task;
 import resource_task::ResourceTask;
 import std::arc::ARC;
 import clone_arc = std::arc::clone;
 import std::cell::Cell;
 import to_str::ToStr;
 
 enum Msg {
     /// Tell the cache that we may need a particular image soon. Must be posted
     /// before Decode
-    Prefetch(url),
+    Prefetch(Url),
 
     /// Used be the prefetch tasks to post back image binaries
-    /*priv*/ StorePrefetchedImageData(url, Result<Cell<~[u8]>, ()>),
+    /*priv*/ StorePrefetchedImageData(Url, Result<Cell<~[u8]>, ()>),
 
     /// Tell the cache to decode an image. Must be posted before GetImage/WaitForImage
-    Decode(url),
+    Decode(Url),
 
     /// Used by the decoder tasks to post decoded images back to the cache
-    /*priv*/ StoreImage(url, Option<ARC<~Image>>),
+    /*priv*/ StoreImage(Url, Option<ARC<~Image>>),
 
     /// Request an Image object for a URL. If the image is not is not immediately
     /// available then ImageNotReady is returned.
-    GetImage(url, Chan<ImageResponseMsg>),
+    GetImage(Url, Chan<ImageResponseMsg>),
 
     /// Wait for an image to become available (or fail to load).
-    WaitForImage(url, Chan<ImageResponseMsg>),
+    WaitForImage(Url, Chan<ImageResponseMsg>),
 
     /// For testing
     /*priv*/ OnMsg(fn~(msg: &Msg)),
 
     /// Clients must wait for a response before shutting down the ResourceTask
     Exit(Chan<()>)
 }
 
@@ -198,28 +198,28 @@ impl ImageCache {
                     break;
                 }
               }
               None => ()
             }
         }
     }
 
-    /*priv*/ fn get_state(+url: url) -> ImageState {
+    /*priv*/ fn get_state(+url: Url) -> ImageState {
         match self.state_map.find(url) {
           Some(state) => state,
           None => Init
         }
     }
 
-    /*priv*/ fn set_state(+url: url, state: ImageState) {
+    /*priv*/ fn set_state(+url: Url, state: ImageState) {
         self.state_map.insert(url, state);
     }
 
-    /*priv*/ fn prefetch(+url: url) {
+    /*priv*/ fn prefetch(+url: Url) {
         match self.get_state(copy url) {
           Init => {
             let to_cache = self.from_client.chan();
             let resource_task = self.resource_task;
             let url_cell = Cell(copy url);
 
             do spawn |move url_cell| {
                 let url = url_cell.take();
@@ -244,17 +244,17 @@ impl ImageCache {
           | Decoding
           | Decoded(*)
           | Failed => {
             // We've already begun working on this image
           }
         }
     }
 
-    /*priv*/ fn store_prefetched_image_data(+url: url, data: &Result<Cell<~[u8]>, ()>) {
+    /*priv*/ fn store_prefetched_image_data(+url: Url, data: &Result<Cell<~[u8]>, ()>) {
         match self.get_state(copy url) {
           Prefetching(next_step) => {
             match *data {
               Ok(data_cell) => {
                 let data = data_cell.take();
                 self.set_state(copy url, Prefetched(@Cell(data)));
                 match next_step {
                   DoDecode => self.decode(url),
@@ -273,17 +273,17 @@ impl ImageCache {
           | Decoding
           | Decoded(*)
           | Failed => {
             fail ~"wrong state for storing prefetched image"
           }
         }
     }
 
-    /*priv*/ fn decode(+url: url) {
+    /*priv*/ fn decode(+url: Url) {
 
         match self.get_state(copy url) {
           Init => fail ~"decoding image before prefetch",
 
           Prefetching(DoNotDecode) => {
             // We don't have the data yet, queue up the decode
             self.set_state(url, Prefetching(DoDecode))
           }
@@ -319,17 +319,17 @@ impl ImageCache {
           Decoding
           | Decoded(*)
           | Failed => {
             // We've already begun decoding
           }
         }
     }
 
-    /*priv*/ fn store_image(+url: url, image: &Option<ARC<~Image>>) {
+    /*priv*/ fn store_image(+url: Url, image: &Option<ARC<~Image>>) {
 
         match self.get_state(copy url) {
           Decoding => {
             match *image {
               Some(image) => {
                 self.set_state(copy url, Decoded(@clone_arc(&image)));
                 self.purge_waiters(url, || ImageReady(clone_arc(&image)) );
               }
@@ -346,30 +346,30 @@ impl ImageCache {
           | Decoded(*)
           | Failed => {
             fail ~"incorrect state in store_image"
           }
         }
 
     }
 
-    /*priv*/ fn purge_waiters(+url: url, f: fn() -> ImageResponseMsg) {
+    /*priv*/ fn purge_waiters(+url: Url, f: fn() -> ImageResponseMsg) {
         match self.wait_map.find(copy url) {
           Some(@waiters) => {
             for waiters.each |response| {
                 response.send(f());
             }
             self.wait_map.remove(url);
           }
           None => ()
         }
     }
 
 
-    /*priv*/ fn get_image(+url: url, response: Chan<ImageResponseMsg>) {
+    /*priv*/ fn get_image(+url: Url, response: Chan<ImageResponseMsg>) {
 
         match self.get_state(copy url) {
           Init => fail ~"request for image before prefetch",
 
           Prefetching(DoDecode) => {
             response.send(ImageNotReady);
           }
 
@@ -385,17 +385,17 @@ impl ImageCache {
           }
 
           Failed => {
             response.send(ImageFailed);
           }
         }
     }
 
-    /*priv*/ fn wait_for_image(+url: url, response: Chan<ImageResponseMsg>) {
+    /*priv*/ fn wait_for_image(+url: Url, response: Chan<ImageResponseMsg>) {
 
         match self.get_state(copy url) {
           Init => fail ~"request for image before prefetch",
 
           Prefetching(DoNotDecode)
           | Prefetched(*) => fail ~"request for image before decode",
 
           Prefetching(DoDecode)
@@ -433,17 +433,17 @@ impl ImageCacheTask: ImageCacheTaskClien
     fn exit() {
         let response = Port();
         self.send(Exit(response.chan()));
         response.recv();
     }
 
 }
 
-fn load_image_data(+url: url, resource_task: ResourceTask) -> Result<~[u8], ()> {
+fn load_image_data(+url: Url, resource_task: ResourceTask) -> Result<~[u8], ()> {
     let response_port = Port();
     resource_task.send(resource_task::Load(url, response_port.chan()));
 
     let mut image_data = ~[];
 
     loop {
         match response_port.recv() {
           resource_task::Payload(data) => {
--- a/servo/src/servo/resource/resource_task.rs
+++ b/servo/src/servo/resource/resource_task.rs
@@ -5,22 +5,21 @@ A task that takes a URL and streams back
 */
 
 export ControlMsg, Load, Exit;
 export ProgressMsg, Payload, Done;
 export ResourceTask, ResourceManager, LoaderTaskFactory;
 
 import comm::{Chan, Port};
 import task::{spawn, spawn_listener};
-import std::net::url;
-import std::net::url::url;
+import std::net::url::{Url, to_str};
 
 enum ControlMsg {
     /// Request the data associated with a particular URL
-    Load(url, Chan<ProgressMsg>),
+    Load(Url, Chan<ProgressMsg>),
     Exit
 }
 
 /// Messages sent in response to a `Load` message
 enum ProgressMsg {
     /// Binary data - there may be multiple of these
     Payload(~[u8]),
     /// Indicates loading is complete, either successfully or not
@@ -43,17 +42,17 @@ impl ProgressMsg: cmp::Eq {
 type ResourceTask = Chan<ControlMsg>;
 
 /**
 Creates a task to load a specific resource
 
 The ResourceManager delegates loading to a different type of loader task for
 each URL scheme
 */
-type LoaderTaskFactory = fn~(+url: url, Chan<ProgressMsg>);
+type LoaderTaskFactory = fn~(+url: Url, Chan<ProgressMsg>);
 
 /// Create a ResourceTask with the default loaders
 fn ResourceTask() -> ResourceTask {
     let loaders = ~[
         (~"file", file_loader::factory),
         (~"http", http_loader::factory)
     ];
     create_resource_task_with_loaders(loaders)
@@ -84,31 +83,31 @@ struct ResourceManager {
               }
               Exit => {
                 break
               }
             }
         }
     }
 
-    fn load(+url: url, progress_chan: Chan<ProgressMsg>) {
+    fn load(+url: Url, progress_chan: Chan<ProgressMsg>) {
 
         match self.get_loader_factory(url) {
           Some(loader_factory) => {
-            #debug("resource_task: loading url: %s", url::to_str(url));
+            #debug("resource_task: loading url: %s", to_str(url));
             loader_factory(url, progress_chan);
           }
           None => {
             #debug("resource_task: no loader for scheme %s", url.scheme);
             progress_chan.send(Done(Err(())));
           }
         }
     }
 
-    fn get_loader_factory(url: url) -> Option<LoaderTaskFactory> {
+    fn get_loader_factory(url: Url) -> Option<LoaderTaskFactory> {
         for self.loaders.each |scheme_loader| {
             let (scheme, loader_factory) = copy scheme_loader;
             if scheme == url.scheme {
                 return Some(loader_factory);
             }
         }
         return None;
     }
--- a/servo/src/servo/util/color.rs
+++ b/servo/src/servo/util/color.rs
@@ -32,20 +32,20 @@ fn hsla(h : float, s : float, l : float,
     let m2 = if l <= 0.5 { l*(s + 1.0) } else { l + s - l*s };
     let m1 = l*2.0 - m2;
     let h = h / 360.0; 
     
     fn hue_to_rgb(m1 : float, m2 : float, h : float) -> float {
         let h = if h < 0.0 { h + 1.0 } else if h > 1.0 { h - 1.0 } else { h };
 
         match h {
-          0.0 to 1.0/6.0 => m1 + (m2 - m1)*h*6.0,
-          1.0/6.0 to 1.0/2.0 => m2,
-          1.0/2.0 to 2.0/3.0 => m1 + (m2 - m1)*(4.0 - 6.0*h),
-          2.0/3.0 to 1.0 => return m1,
+          0.0 .. 1.0/6.0 => m1 + (m2 - m1)*h*6.0,
+          1.0/6.0 .. 1.0/2.0 => m2,
+          1.0/2.0 .. 2.0/3.0 => m1 + (m2 - m1)*(4.0 - 6.0*h),
+          2.0/3.0 .. 1.0 => return m1,
           _ => fail ~"unexpected hue value"
         }
     }
 
     let r = round(255.0*hue_to_rgb(m1, m2, h + 1.0/3.0) as c_double);;
     let g = round(255.0*hue_to_rgb(m1, m2, h) as c_double);
     let b = round(255.0*hue_to_rgb(m1, m2, h - 1.0/3.0) as c_double);
 
--- a/servo/src/servo/util/url.rs
+++ b/servo/src/servo/util/url.rs
@@ -1,27 +1,27 @@
 export make_url, UrlMap, url_map;
 
 import std::net::url;
-import url::{get_scheme, url};
+import std::net::url::Url;
 import std::map::hashmap;
 import path::Path;
 
 /**
 Create a URL object from a string. Does various helpful browsery things like
 
 * If there's no current url and the path looks like a file then it will
   create a file url based of the current working directory
 * If there's a current url and the new path is relative then the new url
   is based off the current url
 
 */
 #[allow(non_implicitly_copyable_typarams)]
-fn make_url(str_url: ~str, current_url: Option<url>) -> url {
-    let mut schm = get_scheme(str_url);
+fn make_url(str_url: ~str, current_url: Option<Url>) -> Url {
+    let mut schm = url::get_scheme(str_url);
     let str_url = if result::is_err(schm) {
         if current_url.is_none() {
             // If all we have is a filename, assume it's a local relative file
             // and build an absolute path with the cwd
             ~"file://" + os::getcwd().push(str_url).to_str()
         } else {
             let current_url = current_url.get();
             #debug("make_url: current_url: %?", current_url);
@@ -95,16 +95,16 @@ mod make_url_tests {
         let new_url = make_url(new_str, Some(old_url));
         assert new_url.scheme == ~"http";
         assert new_url.host == ~"example.com";
         assert new_url.path == ~"/snarf/crumpet.html";
     }
 
 }
 
-type UrlMap<T: copy> = hashmap<url, T>;
+type UrlMap<T: copy> = hashmap<Url, T>;
 
 fn url_map<T: copy>() -> UrlMap<T> {
     import core::to_str::ToStr;
 
-    hashmap::<url, T>(|a| str::hash(&a.to_str()),
+    hashmap::<Url, T>(|a| str::hash(&a.to_str()),
                       |a, b| str::eq(&a.to_str(), &b.to_str()))
 }