diff --git a/src/rust b/src/rust index 783392f70fc..2b09267b762 160000 --- a/src/rust +++ b/src/rust @@ -1 +1 @@ -Subproject commit 783392f70fcfd6770782796bef06bed47043cabf +Subproject commit 2b09267b762398a3c851ecfd55d5d01aee906352 diff --git a/src/rust-core-foundation b/src/rust-core-foundation index a8ebe76090d..556c56eac18 160000 --- a/src/rust-core-foundation +++ b/src/rust-core-foundation @@ -1 +1 @@ -Subproject commit a8ebe76090dd67f24a9da41404878f5316afbf6a +Subproject commit 556c56eac1843120f6ce6c58a2de116b4c214c27 diff --git a/src/rust-css b/src/rust-css index 6ce668e09fb..edfb494a1a2 160000 --- a/src/rust-css +++ b/src/rust-css @@ -1 +1 @@ -Subproject commit 6ce668e09fb378643bb37d1ec5338fa09a8a4d3d +Subproject commit edfb494a1a28d9e3e779ee521d2925bc3244664a diff --git a/src/rust-netsurfcss b/src/rust-netsurfcss index 5ca8bdfcdbb..a65a9768384 160000 --- a/src/rust-netsurfcss +++ b/src/rust-netsurfcss @@ -1 +1 @@ -Subproject commit 5ca8bdfcdbb4c715cd22136f582f2b81df9c7adb +Subproject commit a65a9768384d0ef06f47049fb639aab312ee453a diff --git a/src/rust-wapcaplet b/src/rust-wapcaplet index 1afc08b508d..6a338951c6a 160000 --- a/src/rust-wapcaplet +++ b/src/rust-wapcaplet @@ -1 +1 @@ -Subproject commit 1afc08b508d4980342a715a5d3faef63ac4389c3 +Subproject commit 6a338951c6a8bf76b235f64f3903da84dac0b705 diff --git a/src/servo-gfx/display_list.rs b/src/servo-gfx/display_list.rs index fe26147e4a5..87fdb66d8ff 100644 --- a/src/servo-gfx/display_list.rs +++ b/src/servo-gfx/display_list.rs @@ -34,8 +34,8 @@ pub enum DisplayItem { Border(DisplayItemData, Au, Color) } -pub impl DisplayItem { - fn d(&self) -> &'self DisplayItemData { +pub impl<'self> DisplayItem { + fn d(&'self self) -> &'self DisplayItemData { match *self { SolidColor(ref d, _) => d, Text(ref d, _, _, _) => d, diff --git a/src/servo-gfx/font_context.rs b/src/servo-gfx/font_context.rs index 418163d5925..659aec9b686 100644 --- a/src/servo-gfx/font_context.rs +++ b/src/servo-gfx/font_context.rs @@ -73,7 +73,7 @@ pub impl<'self> FontContext { } } - priv fn get_font_list(&self) -> &'self FontList { + priv fn get_font_list(&'self self) -> &'self FontList { self.font_list.get_ref() } diff --git a/src/servo-gfx/render_task.rs b/src/servo-gfx/render_task.rs index 0b3ae93b99c..4064972782f 100644 --- a/src/servo-gfx/render_task.rs +++ b/src/servo-gfx/render_task.rs @@ -52,15 +52,17 @@ pub fn RenderTask(compositor: C, opts: Opts) -> RenderTask f }; - Renderer { + // FIXME: rust/#5967 + let mut r = Renderer { port: po, compositor: compositor, - mut layer_buffer_set_port: Cell(layer_buffer_set_port), + layer_buffer_set_port: Cell(layer_buffer_set_port), thread_pool: thread_pool, opts: opts_cell.take() - }.start(); + }; + r.start(); }; - SharedChan(render_task) + SharedChan::new(render_task) } /// Data that needs to be kept around for each render thread. @@ -79,7 +81,7 @@ priv struct Renderer { } impl Renderer { - fn start(&self) { + fn start(&mut self) { debug!("renderer: beginning rendering loop"); loop { @@ -93,7 +95,7 @@ impl Renderer { } } - fn render(&self, render_layer: RenderLayer) { + fn render(&mut self, render_layer: RenderLayer) { debug!("renderer: got render request"); let layer_buffer_set_port = self.layer_buffer_set_port.take(); diff --git a/src/servo-gfx/resource/http_loader.rs b/src/servo-gfx/resource/http_loader.rs index f5cbf9b1cef..eed67c19065 100644 --- a/src/servo-gfx/resource/http_loader.rs +++ b/src/servo-gfx/resource/http_loader.rs @@ -12,7 +12,7 @@ pub fn factory() -> LoaderTask { let f: LoaderTask = |url, progress_chan| { assert!(url.scheme == ~"http"); - let progress_chan = SharedChan(progress_chan); + let progress_chan = SharedChan::new(progress_chan); do spawn { debug!("http_loader: requesting via http: %?", url.clone()); let mut request = uv_http_request(url.clone()); diff --git a/src/servo-gfx/resource/image_cache_task.rs b/src/servo-gfx/resource/image_cache_task.rs index 51568c80da9..f6ad4b2d734 100644 --- a/src/servo-gfx/resource/image_cache_task.rs +++ b/src/servo-gfx/resource/image_cache_task.rs @@ -96,7 +96,7 @@ pub fn ImageCacheTask_(resource_task: ResourceTask, let decoder_factory_cell = Cell(decoder_factory); let (port, chan) = stream(); - let chan = SharedChan(chan); + let chan = SharedChan::new(chan); let port_cell = Cell(port); let chan_cell = Cell(chan.clone()); @@ -140,7 +140,7 @@ fn SyncImageCacheTask(resource_task: ResourceTask) -> ImageCacheTask { } } - return SharedChan(chan); + return SharedChan::new(chan); } struct ImageCache { diff --git a/src/servo-gfx/resource/resource_task.rs b/src/servo-gfx/resource/resource_task.rs index bfaa5fa25a0..3b989f478e9 100644 --- a/src/servo-gfx/resource/resource_task.rs +++ b/src/servo-gfx/resource/resource_task.rs @@ -59,7 +59,7 @@ fn create_resource_task_with_loaders(loaders: ~[(~str, LoaderTaskFactory)]) -> R // TODO: change copy to move once we can move out of closures ResourceManager(from_client, loaders_cell.take()).start() }; - SharedChan(chan) + SharedChan::new(chan) } pub struct ResourceManager { diff --git a/src/servo-gfx/text/glyph.rs b/src/servo-gfx/text/glyph.rs index 4e743cf9a0c..3ecc291cc83 100644 --- a/src/servo-gfx/text/glyph.rs +++ b/src/servo-gfx/text/glyph.rs @@ -306,7 +306,7 @@ struct DetailedGlyphStore { lookup_is_sorted: bool, } -impl DetailedGlyphStore { +impl<'self> DetailedGlyphStore { fn new() -> DetailedGlyphStore { DetailedGlyphStore { detail_buffer: ~[], // TODO: default size? @@ -339,7 +339,7 @@ impl DetailedGlyphStore { self.lookup_is_sorted = false; } - fn get_detailed_glyphs_for_entry(&self, entry_offset: uint, count: u16) + fn get_detailed_glyphs_for_entry(&'self self, entry_offset: uint, count: u16) -> &'self [DetailedGlyph] { debug!("Requesting detailed glyphs[n=%u] for entry[off=%u]", count as uint, entry_offset); @@ -369,7 +369,7 @@ impl DetailedGlyphStore { } } - fn get_detailed_glyph_with_index(&self, + fn get_detailed_glyph_with_index(&'self self, entry_offset: uint, detail_offset: u16) -> &'self DetailedGlyph { @@ -507,7 +507,7 @@ pub struct GlyphStore { detail_store: DetailedGlyphStore, } -pub impl GlyphStore { +pub impl<'self> GlyphStore { // Initializes the glyph store, but doesn't actually shape anything. // Use the set_glyph, set_glyphs() methods to store glyph data. fn new(length: uint) -> GlyphStore { @@ -585,7 +585,7 @@ pub impl GlyphStore { self.entry_buffer[i] = entry; } - fn iter_glyphs_for_char_index(&self, + fn iter_glyphs_for_char_index(&'self self, i: uint, cb: &fn(uint, &GlyphInfo<'self>) -> bool) -> bool { @@ -609,7 +609,8 @@ pub impl GlyphStore { true } - fn iter_glyphs_for_char_range(&self, range: &Range, cb: &fn(uint, &GlyphInfo<'self>) -> bool) { + fn iter_glyphs_for_char_range(&'self self, range: &Range, + cb: &fn(uint, &GlyphInfo<'self>) -> bool) { if range.begin() >= self.entry_buffer.len() { error!("iter_glyphs_for_range: range.begin beyond length!"); return; @@ -626,7 +627,7 @@ pub impl GlyphStore { } } - fn iter_all_glyphs(&self, cb: &fn(uint, &GlyphInfo<'self>) -> bool) { + fn iter_all_glyphs(&'self self, cb: &fn(uint, &GlyphInfo<'self>) -> bool) { for uint::range(0, self.entry_buffer.len()) |i| { if !self.iter_glyphs_for_char_index(i, cb) { break; diff --git a/src/servo-gfx/text/text_run.rs b/src/servo-gfx/text/text_run.rs index aac41e9e1ee..ff5f9cba343 100644 --- a/src/servo-gfx/text/text_run.rs +++ b/src/servo-gfx/text/text_run.rs @@ -37,7 +37,7 @@ impl SendableTextRun { } } -pub impl TextRun { +pub impl<'self> TextRun { fn new(font: @mut Font, text: ~str) -> TextRun { let mut glyph_store = GlyphStore::new(str::char_len(text)); TextRun::compute_potential_breaks(text, &mut glyph_store); @@ -102,7 +102,7 @@ pub impl TextRun { } fn char_len(&self) -> uint { self.glyphs.entry_buffer.len() } - fn glyphs(&self) -> &'self GlyphStore { &self.glyphs } + fn glyphs(&'self self) -> &'self GlyphStore { &self.glyphs } fn range_is_trimmable_whitespace(&self, range: &Range) -> bool { for range.eachi |i| { diff --git a/src/servo-util/vec.rs b/src/servo-util/vec.rs index fdbe80d1504..8a0ebf9edfa 100644 --- a/src/servo-util/vec.rs +++ b/src/servo-util/vec.rs @@ -4,12 +4,12 @@ use core::cmp::{Ord, Eq}; -pub trait BinarySearchMethods { +pub trait BinarySearchMethods<'self, T: Ord + Eq> { fn binary_search(&self, key: &T) -> Option<&'self T>; fn binary_search_index(&self, key: &T) -> Option; } -impl<'self, T: Ord + Eq> BinarySearchMethods for &'self [T] { +impl<'self, T: Ord + Eq> BinarySearchMethods<'self, T> for &'self [T] { fn binary_search(&self, key: &T) -> Option<&'self T> { match self.binary_search_index(key) { None => None, diff --git a/src/servo/content/content_task.rs b/src/servo/content/content_task.rs index c07f4c4b907..71857b92ae9 100644 --- a/src/servo/content/content_task.rs +++ b/src/servo/content/content_task.rs @@ -60,7 +60,7 @@ pub fn ContentTask(layout_task: LayoutTask, -> ContentTask { let (control_port, control_chan) = comm::stream(); - let control_chan = SharedChan(control_chan); + let control_chan = SharedChan::new(control_chan); let control_chan_copy = control_chan.clone(); let control_port = Cell(control_port); let dom_event_port = Cell(dom_event_port); diff --git a/src/servo/css/node_style.rs b/src/servo/css/node_style.rs index 128507a282d..5dce11b8f34 100644 --- a/src/servo/css/node_style.rs +++ b/src/servo/css/node_style.rs @@ -10,11 +10,11 @@ use newcss::complete::CompleteStyle; /// Node mixin providing `style` method that returns a `NodeStyle` pub trait StyledNode { - fn style(&self) -> CompleteStyle<'self>; + fn style<'a>(&'a self) -> CompleteStyle<'a>; } impl StyledNode for AbstractNode { - fn style(&self) -> CompleteStyle<'self> { + fn style<'a>(&'a self) -> CompleteStyle<'a> { assert!(self.is_element()); // Only elements can have styles let results = self.get_css_select_results(); results.computed_style() diff --git a/src/servo/dom/element.rs b/src/servo/dom/element.rs index feb631a234c..d366320a701 100644 --- a/src/servo/dom/element.rs +++ b/src/servo/dom/element.rs @@ -112,7 +112,7 @@ pub struct HTMLImageElement { // Element methods // -pub impl Element { +pub impl<'self> Element { pub fn new(type_id: ElementTypeId, tag_name: ~str) -> Element { Element { parent: Node::new(ElementNodeTypeId(type_id)), @@ -121,7 +121,7 @@ pub impl Element { } } - fn get_attr(&self, name: &str) -> Option<&'self str> { + fn get_attr(&'self self, name: &str) -> Option<&'self str> { // FIXME: Need an each() that links lifetimes in Rust. for uint::range(0, self.attrs.len()) |i| { if eq_slice(self.attrs[i].name, name) { diff --git a/src/servo/html/hubbub_html_parser.rs b/src/servo/html/hubbub_html_parser.rs index 5abb93d6608..7dfdae3cc9a 100644 --- a/src/servo/html/hubbub_html_parser.rs +++ b/src/servo/html/hubbub_html_parser.rs @@ -211,7 +211,7 @@ pub fn parse_html(url: Url, css_chan: Chan>| { css_link_listener(css_chan, css_port, resource_task2.clone()); }; - let css_chan = SharedChan(css_chan); + let css_chan = SharedChan::new(css_chan); // Spawn a JS parser to receive JavaScript. let resource_task2 = resource_task.clone(); @@ -220,7 +220,7 @@ pub fn parse_html(url: Url, js_chan: Chan| { js_script_listener(js_chan, js_port, resource_task2.clone()); }; - let js_chan = SharedChan(js_chan); + let js_chan = SharedChan::new(js_chan); let url2 = url.clone(), url3 = url.clone(); diff --git a/src/servo/layout/box.rs b/src/servo/layout/box.rs index b3996250cce..a7a56109525 100644 --- a/src/servo/layout/box.rs +++ b/src/servo/layout/box.rs @@ -113,8 +113,8 @@ pub fn RenderBoxData(node: AbstractNode, ctx: @mut FlowContext, id: int) -> Rend } } -impl RenderBox { - fn d(&mut self) -> &'self mut RenderBoxData { +impl<'self> RenderBox { + fn d(&'self mut self) -> &'self mut RenderBoxData { unsafe { //Rust #5074 - we can't take mutable references to the // data that needs to be returned right now. @@ -351,7 +351,7 @@ impl RenderBox { self.content_box() } - fn style(&mut self) -> CompleteStyle<'self> { + fn style(&'self mut self) -> CompleteStyle<'self> { let d: &'self mut RenderBoxData = self.d(); d.node.style() } diff --git a/src/servo/layout/flow.rs b/src/servo/layout/flow.rs index 8402dd3288b..a2ef3d282b9 100644 --- a/src/servo/layout/flow.rs +++ b/src/servo/layout/flow.rs @@ -96,8 +96,8 @@ pub fn FlowData(id: int) -> FlowData { } } -pub impl FlowContext { - fn d(&mut self) -> &'self mut FlowData { +pub impl<'self> FlowContext { + fn d(&'self mut self) -> &'self mut FlowData { unsafe { match *self { AbsoluteFlow(ref d) => cast::transmute(d), @@ -111,21 +111,21 @@ pub impl FlowContext { } } - fn inline(&mut self) -> &'self mut InlineFlowData { + fn inline(&'self mut self) -> &'self mut InlineFlowData { match self { &InlineFlow(_, ref i) => unsafe { cast::transmute(i) }, _ => fail!(fmt!("Tried to access inline data of non-inline: f%d", self.d().id)) } } - fn block(&mut self) -> &'self mut BlockFlowData { + fn block(&'self mut self) -> &'self mut BlockFlowData { match self { &BlockFlow(_, ref mut b) => unsafe { cast::transmute(b) }, _ => fail!(fmt!("Tried to access block data of non-block: f%d", self.d().id)) } } - fn root(&mut self) -> &'self mut RootFlowData { + fn root(&'self mut self) -> &'self mut RootFlowData { match self { &RootFlow(_, ref r) => unsafe { cast::transmute(r) }, _ => fail!(fmt!("Tried to access root data of non-root: f%d", self.d().id)) diff --git a/src/servo/layout/layout_task.rs b/src/servo/layout/layout_task.rs index 199d9a4615a..5045760283e 100644 --- a/src/servo/layout/layout_task.rs +++ b/src/servo/layout/layout_task.rs @@ -86,7 +86,7 @@ pub struct BuildData { pub fn LayoutTask(render_task: RenderTask, img_cache_task: ImageCacheTask, opts: Opts) -> LayoutTask { - SharedChan(spawn_listener::(|from_content| { + SharedChan::new(spawn_listener::(|from_content| { let mut layout = Layout(render_task.clone(), img_cache_task.clone(), from_content, &opts); layout.start(); })) diff --git a/src/servo/platform/osmain.rs b/src/servo/platform/osmain.rs index 88d192612b1..c9db90f068e 100644 --- a/src/servo/platform/osmain.rs +++ b/src/servo/platform/osmain.rs @@ -56,7 +56,7 @@ pub enum Msg { pub fn OSMain(dom_event_chan: comm::SharedChan, opts: Opts) -> OSMain { let dom_event_chan = Cell(dom_event_chan); OSMain { - chan: SharedChan(on_osmain::(|po| { + chan: SharedChan::new(on_osmain::(|po| { let po = Cell(po); do platform::runmain { debug!("preparing to enter main loop"); diff --git a/src/servo/servo.rc b/src/servo/servo.rc index ddcd8d5df3c..30db1ec3c81 100755 --- a/src/servo/servo.rc +++ b/src/servo/servo.rc @@ -135,7 +135,7 @@ fn run(opts: &Opts) { fn run_pipeline_screen(opts: &Opts) { let (dom_event_port, dom_event_chan) = comm::stream(); - let dom_event_chan = comm::SharedChan(dom_event_chan); + let dom_event_chan = comm::SharedChan::new(dom_event_chan); // The platform event handler thread let osmain = OSMain(dom_event_chan.clone(), copy *opts);