diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 2e511e342e9..b828ccb74bd 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1040,7 +1040,7 @@ class CGArgumentConverter(CGThing): else: assert argument.optional variadicConversion = { - "val": string.Template("(*${argv}.offset(variadicArg as int))").substitute(replacer), + "val": string.Template("(*${argv}.offset(variadicArg as isize))").substitute(replacer), } innerConverter = instantiateJSToNativeConversionTemplate( template, variadicConversion, declType, "slot", diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 0dbe3bd4c78..5f726ac5d1a 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -321,7 +321,7 @@ impl RootedCollectionSet { ROOTED_COLLECTIONS.with(|ref collections| { let type_ = VecRootableType::tag(None::); let mut collections = collections.borrow_mut(); - assert!(collections.set[type_ as uint].remove(&(collection as *const _ as *const _))); + assert!(collections.set[type_ as usize].remove(&(collection as *const _ as *const _))); }); } @@ -329,7 +329,7 @@ impl RootedCollectionSet { ROOTED_COLLECTIONS.with(|ref collections| { let type_ = VecRootableType::tag(None::); let mut collections = collections.borrow_mut(); - collections.set[type_ as uint].insert(collection as *const _ as *const _); + collections.set[type_ as usize].insert(collection as *const _ as *const _); }) } @@ -345,15 +345,15 @@ impl RootedCollectionSet { } } - let dom_collections = &self.set[CollectionType::DOMObjects as uint] as *const _ as *const HashSet<*const RootedVec<*const Reflector>>; + let dom_collections = &self.set[CollectionType::DOMObjects as usize] as *const _ as *const HashSet<*const RootedVec<*const Reflector>>; for dom_collection in (*dom_collections).iter() { for reflector in (**dom_collection).iter() { trace_reflector(tracer, "", &**reflector); } } - trace_collection_type::(tracer, &self.set[CollectionType::JSVals as uint]); - trace_collection_type::<*mut JSObject>(tracer, &self.set[CollectionType::JSObjects as uint]); + trace_collection_type::(tracer, &self.set[CollectionType::JSVals as usize]); + trace_collection_type::<*mut JSObject>(tracer, &self.set[CollectionType::JSObjects as usize]); } } diff --git a/components/script/dom/browsercontext.rs b/components/script/dom/browsercontext.rs index d7e3eb90500..328182e2942 100644 --- a/components/script/dom/browsercontext.rs +++ b/components/script/dom/browsercontext.rs @@ -32,7 +32,7 @@ use std::ptr; #[privatize] pub struct BrowserContext { history: Vec, - active_index: uint, + active_index: usize, window_proxy: *mut JSObject, frame_element: Option>, } diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index ca3f7539501..0fc20157eb0 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -339,7 +339,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> { let elements = entry.into_mut(); let new_node: JSRef = NodeCast::from_ref(element); - let mut head: uint = 0u; + let mut head: usize = 0; let root: JSRef = NodeCast::from_ref(root.r()); for node in root.traverse_preorder() { let elem: Option> = ElementCast::to_ref(node); diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index c9da863096c..4b1bccab86c 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -63,7 +63,7 @@ impl<'a> ImageDataHelpers for JSRef<'a, ImageData> { let cx = global.get_cx(); let data: *const uint8_t = JS_GetUint8ClampedArrayData(self.Data(cx), cx) as *const uint8_t; let len = self.Width() * self.Height() * 4; - slice::from_raw_parts(data, len as uint).to_vec() + slice::from_raw_parts(data, len as usize).to_vec() } } diff --git a/components/script/dom/namednodemap.rs b/components/script/dom/namednodemap.rs index 6b6bf0e64cd..bfa8f1652f1 100644 --- a/components/script/dom/namednodemap.rs +++ b/components/script/dom/namednodemap.rs @@ -45,7 +45,7 @@ impl<'a> NamedNodeMapMethods for JSRef<'a, NamedNodeMap> { // FIXME(https://github.com/rust-lang/rust/issues/23338) let owner = owner.r(); let attrs = owner.attrs(); - attrs.as_slice().get(index as uint).map(|x| Temporary::new(x.clone())) + attrs.as_slice().get(index as usize).map(|x| Temporary::new(x.clone())) } fn IndexedGetter(self, index: u32, found: &mut bool) -> Option> { diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index c8977440c43..a302308d33a 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -475,7 +475,7 @@ pub trait NodeHelpers<'a> { fn dirty_impl(self, damage: NodeDamage, force_ancestors: bool); fn dump(self); - fn dump_indent(self, indent: uint); + fn dump_indent(self, indent: u32); fn debug_str(self) -> String; fn traverse_preorder(self) -> TreeIterator<'a>; @@ -514,9 +514,9 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { } /// Dumps the node tree, for debugging, with indentation. - fn dump_indent(self, indent: uint) { + fn dump_indent(self, indent: u32) { let mut s = String::new(); - for _ in range(0, indent) { + for _ in 0..indent { s.push_str(" "); } @@ -526,7 +526,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { // FIXME: this should have a pure version? for kid in self.children() { let kid = kid.root(); - kid.r().dump_indent(indent + 1u) + kid.r().dump_indent(indent + 1) } } @@ -886,10 +886,10 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { uniqueId: unique_id.clone(), baseURI: self.GetBaseURI().unwrap_or("".to_owned()), parent: self.GetParentNode().root().map(|node| node.r().get_unique_id()).unwrap_or("".to_owned()), - nodeType: self.NodeType() as uint, + nodeType: self.NodeType() as usize, namespaceURI: "".to_owned(), //FIXME nodeName: self.NodeName(), - numChildren: self.ChildNodes().root().r().Length() as uint, + numChildren: self.ChildNodes().root().r().Length() as usize, //FIXME doctype nodes only name: "".to_owned(), diff --git a/components/script/dom/performance.rs b/components/script/dom/performance.rs index 45fa9ffe002..ef0238ea4fc 100644 --- a/components/script/dom/performance.rs +++ b/components/script/dom/performance.rs @@ -51,7 +51,7 @@ impl<'a> PerformanceMethods for JSRef<'a, Performance> { // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now fn Now(self) -> DOMHighResTimeStamp { let navStart = self.timing.root().r().NavigationStartPrecise(); - let now = (time::precise_time_ns() as f64 - navStart) * 1000000u as f64; + let now = (time::precise_time_ns() as f64 - navStart) * 1000000 as f64; Finite::wrap(now) } } diff --git a/components/script/dom/treewalker.rs b/components/script/dom/treewalker.rs index d13b730af0d..1957999bcf4 100644 --- a/components/script/dom/treewalker.rs +++ b/components/script/dom/treewalker.rs @@ -330,7 +330,7 @@ impl<'a> PrivateTreeWalkerHelpers for JSRef<'a, TreeWalker> { fn accept_node(self, node: JSRef) -> Fallible { // "To filter node run these steps:" // "1. Let n be node's nodeType attribute value minus 1." - let n: uint = node.NodeType() as uint - 1; + let n = node.NodeType() - 1; // "2. If the nth bit (where 0 is the least significant bit) of whatToShow is not set, // return FILTER_SKIP." if (self.what_to_show & (1 << n)) == 0 { diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index a973d1e970a..5a944454f8b 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -94,7 +94,7 @@ impl Runnable for XHRProgressHandler { #[derive(PartialEq, Clone, Copy)] #[jstraceable] -pub struct GenerationId(uint); +pub struct GenerationId(u32); #[derive(Clone)] pub enum XHRProgress { @@ -148,7 +148,7 @@ pub struct XMLHttpRequest { request_method: DOMRefCell, request_url: DOMRefCell>, request_headers: DOMRefCell, - request_body_len: Cell, + request_body_len: Cell, sync: Cell, upload_complete: Cell, upload_events: Cell, diff --git a/components/script/lib.rs b/components/script/lib.rs index 44ac6f1856c..157e0e27bdb 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -7,7 +7,6 @@ #![feature(collections)] #![feature(core)] #![feature(custom_attribute)] -#![feature(int_uint)] #![feature(old_io)] #![feature(path)] #![feature(plugin)] diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 470257495b9..8239c08c58f 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -225,9 +225,9 @@ impl TextInput { if adjust.abs() as usize > remaining && self.edit_point.line > 0 { self.adjust_vertical(-1, select); self.edit_point.index = self.current_line_length(); - self.adjust_horizontal(adjust + remaining as int + 1, select); + self.adjust_horizontal(adjust + remaining as isize + 1, select); } else { - self.edit_point.index = max(0, self.edit_point.index as int + adjust) as usize; + self.edit_point.index = max(0, self.edit_point.index as isize + adjust) as usize; } } else { let remaining = self.current_line_length() - self.edit_point.index; @@ -235,7 +235,7 @@ impl TextInput { self.adjust_vertical(1, select); self.edit_point.index = 0; // one shift is consumed by the change of line, hence the -1 - self.adjust_horizontal(adjust - remaining as int - 1, select); + self.adjust_horizontal(adjust - remaining as isize - 1, select); } else { self.edit_point.index = min(self.current_line_length(), self.edit_point.index + adjust as usize);