servo: Merge #17149 - Update Rust nightly (from servo:rustup); r=emilio
authorAnthony Ramine <n.oxyde@gmail.com>
Fri, 09 Jun 2017 02:41:16 -0700
changeset 591722 4a4ab5c308b09be400c5167ffe1b430f843cbce9
parent 591721 05dddaa0010fc5b4b3592450d052edd22e8eec7d
child 591723 b996f14177a63f5f27d5222e8f1f86e9155e98da
push id63147
push userbmo:ato@mozilla.com
push dateFri, 09 Jun 2017 14:09:19 +0000
reviewersemilio
milestone55.0a1
servo: Merge #17149 - Update Rust nightly (from servo:rustup); r=emilio Source-Repo: https://github.com/servo/servo Source-Revision: 9656341f43cc1bc415e07a0a0c919740280ad2ab
servo/components/net/image_cache.rs
servo/components/net/lib.rs
servo/components/net_traits/image/base.rs
servo/components/net_traits/lib.rs
servo/components/script_plugins/unrooted_must_root.rs
servo/rust-commit-hash
--- a/servo/components/net/image_cache.rs
+++ b/servo/components/net/image_cache.rs
@@ -102,17 +102,17 @@ fn is_image_opaque(format: webrender_tra
         webrender_traits::ImageFormat::A8 => false,
         webrender_traits::ImageFormat::Invalid | webrender_traits::ImageFormat::RGBAF32 => unreachable!(),
     }
 }
 
 fn premultiply(data: &mut [u8]) {
     let length = data.len();
 
-    for i in (0..length).step_by(4) {
+    for i in Iterator::step_by(0..length, 4) {
         let b = data[i + 0] as u32;
         let g = data[i + 1] as u32;
         let r = data[i + 2] as u32;
         let a = data[i + 3] as u32;
 
         data[i + 0] = (b * a / 255) as u8;
         data[i + 1] = (g * a / 255) as u8;
         data[i + 2] = (r * a / 255) as u8;
--- a/servo/components/net/lib.rs
+++ b/servo/components/net/lib.rs
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #![deny(unsafe_code)]
 #![feature(box_syntax)]
-#![feature(step_by)]
+#![feature(iterator_step_by)]
 
 extern crate base64;
 extern crate brotli;
 extern crate cookie as cookie_rs;
 extern crate devtools_traits;
 extern crate flate2;
 extern crate hyper;
 extern crate hyper_openssl;
--- a/servo/components/net_traits/image/base.rs
+++ b/servo/components/net_traits/image/base.rs
@@ -37,17 +37,17 @@ pub struct ImageMetadata {
 
 // FIXME: Images must not be copied every frame. Instead we should atomically
 // reference count them.
 
 // TODO(pcwalton): Speed up with SIMD, or better yet, find some way to not do this.
 fn byte_swap_and_premultiply(data: &mut [u8]) {
     let length = data.len();
 
-    for i in (0..length).step_by(4) {
+    for i in Iterator::step_by(0..length, 4) {
         let r = data[i + 2];
         let g = data[i + 1];
         let b = data[i + 0];
 
         data[i + 0] = r;
         data[i + 1] = g;
         data[i + 2] = b;
     }
--- a/servo/components/net_traits/lib.rs
+++ b/servo/components/net_traits/lib.rs
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #![feature(box_syntax)]
-#![feature(step_by)]
+#![feature(iterator_step_by)]
 
 #![deny(unsafe_code)]
 
 extern crate cookie as cookie_rs;
 extern crate heapsize;
 #[macro_use]
 extern crate heapsize_derive;
 extern crate hyper;
--- a/servo/components/script_plugins/unrooted_must_root.rs
+++ b/servo/components/script_plugins/unrooted_must_root.rs
@@ -135,26 +135,26 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> fo
             visit::FnKind::Method(n, _, _, _) => {
                 &*n.as_str() == "new" || n.as_str().starts_with("new_")
             }
             visit::FnKind::Closure(_) => return,
         };
 
         if !in_derive_expn(span) {
             let def_id = cx.tcx.hir.local_def_id(id);
-            let ty = cx.tcx.type_of(def_id);
+            let sig = cx.tcx.type_of(def_id).fn_sig();
 
-            for (arg, ty) in decl.inputs.iter().zip(ty.fn_args().0.iter()) {
+            for (arg, ty) in decl.inputs.iter().zip(sig.inputs().0.iter()) {
                 if is_unrooted_ty(cx, ty, false) {
                     cx.span_lint(UNROOTED_MUST_ROOT, arg.span, "Type must be rooted")
                 }
             }
 
             if !in_new_function {
-                if is_unrooted_ty(cx, ty.fn_ret().0, false) {
+                if is_unrooted_ty(cx, sig.output().0, false) {
                     cx.span_lint(UNROOTED_MUST_ROOT, decl.output.span(), "Type must be rooted")
                 }
             }
         }
 
         let mut visitor = FnDefVisitor {
             cx: cx,
             in_new_function: in_new_function,
@@ -213,21 +213,14 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> 
                             pat.span,
                             &format!("Expression of type {:?} must be rooted", ty))
             }
         }
 
         visit::walk_pat(self, pat);
     }
 
-    fn visit_fn(&mut self, kind: visit::FnKind<'tcx>, decl: &'tcx hir::FnDecl,
-                body: hir::BodyId, span: codemap::Span, id: ast::NodeId) {
-        if let visit::FnKind::Closure(_) = kind {
-            visit::walk_fn(self, kind, decl, body, span, id);
-        }
-    }
+    fn visit_ty(&mut self, _: &'tcx hir::Ty) {}
 
-    fn visit_foreign_item(&mut self, _: &'tcx hir::ForeignItem) {}
-    fn visit_ty(&mut self, _: &'tcx hir::Ty) { }
     fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap<'this, 'tcx> {
         hir::intravisit::NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir)
     }
 }
--- a/servo/rust-commit-hash
+++ b/servo/rust-commit-hash
@@ -1,1 +1,1 @@
-03bed655142dd5e42ba4539de53b3663d8a123e0
+2416e222ecae76a36e958a8f7c4ac8083eb1ca45