servo: Merge #15351 - Upgrade to rustc 1.17.0-nightly (ea7a6486a 2017-02-04) (from servo:rustup); r=nox
authorSimon Sapin <simon.sapin@exyr.org>
Sun, 05 Feb 2017 07:01:32 -0800
changeset 341490 5dae888298ae12ec004ac4db53a23ee23d66144d
parent 341489 6cb09150147cbfd47cb8fd2b5611a190ad72bf9d
child 341491 e1bd338a3611d801405e51a4aaddcbe58f8902b4
push id86727
push userkwierso@gmail.com
push dateThu, 09 Feb 2017 00:21:26 +0000
treeherdermozilla-inbound@55a4f5189115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #15351 - Upgrade to rustc 1.17.0-nightly (ea7a6486a 2017-02-04) (from servo:rustup); r=nox <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: cd63f1b158807035d2a83584e64329015a3fff4d
servo/components/plugins/lints/inheritance_integrity.rs
servo/components/plugins/lints/privatize.rs
servo/components/plugins/lints/unrooted_must_root.rs
servo/rust-nightly-date
--- a/servo/components/plugins/lints/inheritance_integrity.rs
+++ b/servo/components/plugins/lints/inheritance_integrity.rs
@@ -22,17 +22,17 @@ impl LintPass for InheritancePass {
     }
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InheritancePass {
     fn check_struct_def(&mut self, cx: &LateContext, def: &hir::VariantData, _n: ast::Name,
                         _gen: &hir::Generics, id: ast::NodeId) {
         // Lints are run post expansion, so it's fine to use
         // #[_dom_struct_marker] here without also checking for #[dom_struct]
-        if cx.tcx.has_attr(cx.tcx.map.local_def_id(id), "_dom_struct_marker") {
+        if cx.tcx.has_attr(cx.tcx.hir.local_def_id(id), "_dom_struct_marker") {
             // Find the reflector, if any
             let reflector_span = def.fields().iter().enumerate()
                                     .find(|&(ctr, f)| {
                                         if match_lang_ty(cx, &*f.ty, "reflector") {
                                             if ctr > 0 {
                                                 cx.span_lint(INHERITANCE_INTEGRITY, f.span,
                                                              "The Reflector should be the first field of the DOM \
                                                              struct");
@@ -61,36 +61,36 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> fo
                 }
                 None
             }).collect();
 
             // We should not have both a reflector and a dom struct field
             if let Some(sp) = reflector_span {
                 if dom_spans.len() > 0 {
                     let mut db = cx.struct_span_lint(INHERITANCE_INTEGRITY,
-                                                     cx.tcx.map.expect_item(id).span,
+                                                     cx.tcx.hir.expect_item(id).span,
                                                      "This DOM struct has both Reflector \
                                                       and bare DOM struct members");
                     if cx.current_level(INHERITANCE_INTEGRITY) != Level::Allow {
                         db.span_note(sp, "Reflector found here");
                         for span in &dom_spans {
                             db.span_note(*span, "Bare DOM struct found here");
                         }
                     }
                 }
             // Nor should we have more than one dom struct field
             } else if dom_spans.len() > 1 {
                 let mut db = cx.struct_span_lint(INHERITANCE_INTEGRITY,
-                                                 cx.tcx.map.expect_item(id).span,
+                                                 cx.tcx.hir.expect_item(id).span,
                                                  "This DOM struct has multiple \
                                                   DOM struct members, only one is allowed");
                 if cx.current_level(INHERITANCE_INTEGRITY) != Level::Allow {
                     for span in &dom_spans {
                         db.span_note(*span, "Bare DOM struct found here");
                     }
                 }
             } else if dom_spans.is_empty() {
-                cx.span_lint(INHERITANCE_INTEGRITY, cx.tcx.map.expect_item(id).span,
+                cx.span_lint(INHERITANCE_INTEGRITY, cx.tcx.hir.expect_item(id).span,
                              "This DOM struct has no reflector or parent DOM struct");
             }
         }
     }
 }
--- a/servo/components/plugins/lints/privatize.rs
+++ b/servo/components/plugins/lints/privatize.rs
@@ -23,17 +23,17 @@ impl LintPass for PrivatizePass {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PrivatizePass {
     fn check_struct_def(&mut self,
                         cx: &LateContext,
                         def: &hir::VariantData,
                         _n: ast::Name,
                         _gen: &hir::Generics,
                         id: ast::NodeId) {
-        if cx.tcx.has_attr(cx.tcx.map.local_def_id(id), "privatize") {
+        if cx.tcx.has_attr(cx.tcx.hir.local_def_id(id), "privatize") {
             for field in def.fields() {
                 if field.vis == hir::Public {
                     cx.span_lint(PRIVATIZE, field.span,
                                  &format!("Field {} is public where only private fields are allowed",
                                           field.name));
                 }
             }
         }
--- a/servo/components/plugins/lints/unrooted_must_root.rs
+++ b/servo/components/plugins/lints/unrooted_must_root.rs
@@ -51,21 +51,23 @@ fn is_unrooted_ty(cx: &LateContext, ty: 
                     false
                 } else if match_def_path(cx, did.did, &["core", "cell", "Ref"])
                         || match_def_path(cx, did.did, &["core", "cell", "RefMut"])
                         || match_def_path(cx, did.did, &["core", "slice", "Iter"])
                         || match_def_path(cx, did.did, &["std", "collections", "hash", "map", "OccupiedEntry"])
                         || match_def_path(cx, did.did, &["std", "collections", "hash", "map", "VacantEntry"]) {
                     // Structures which are semantically similar to an &ptr.
                     false
+                } else if did.is_box() && in_new_function {
+                    // box in new() is okay
+                    false
                 } else {
                     true
                 }
             },
-            ty::TyBox(..) if in_new_function => false, // box in new() is okay
             ty::TyRef(..) => false, // don't recurse down &ptrs
             ty::TyRawPtr(..) => false, // don't recurse down *ptrs
             ty::TyFnDef(..) | ty::TyFnPtr(_) => false,
             _ => true
         }
     });
     ret
 }
@@ -79,39 +81,39 @@ impl LintPass for UnrootedPass {
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
     /// All structs containing #[must_root] types must be #[must_root] themselves
     fn check_struct_def(&mut self,
                         cx: &LateContext,
                         def: &hir::VariantData,
                         _n: ast::Name,
                         _gen: &hir::Generics,
                         id: ast::NodeId) {
-        let item = match cx.tcx.map.get(id) {
+        let item = match cx.tcx.hir.get(id) {
             ast_map::Node::NodeItem(item) => item,
-            _ => cx.tcx.map.expect_item(cx.tcx.map.get_parent(id)),
+            _ => cx.tcx.hir.expect_item(cx.tcx.hir.get_parent(id)),
         };
         if item.attrs.iter().all(|a| !a.check_name("must_root")) {
             for ref field in def.fields() {
-                let def_id = cx.tcx.map.local_def_id(field.id);
+                let def_id = cx.tcx.hir.local_def_id(field.id);
                 if is_unrooted_ty(cx, cx.tcx.item_type(def_id), false) {
                     cx.span_lint(UNROOTED_MUST_ROOT, field.span,
                                  "Type must be rooted, use #[must_root] on the struct definition to propagate")
                 }
             }
         }
     }
 
     /// All enums containing #[must_root] types must be #[must_root] themselves
     fn check_variant(&mut self, cx: &LateContext, var: &hir::Variant, _gen: &hir::Generics) {
-        let ref map = cx.tcx.map;
+        let ref map = cx.tcx.hir;
         if map.expect_item(map.get_parent(var.node.data.id())).attrs.iter().all(|a| !a.check_name("must_root")) {
             match var.node.data {
                 hir::VariantData::Tuple(ref fields, _) => {
                     for ref field in fields {
-                        let def_id = cx.tcx.map.local_def_id(field.id);
+                        let def_id = cx.tcx.hir.local_def_id(field.id);
                         if is_unrooted_ty(cx, cx.tcx.item_type(def_id), false) {
                             cx.span_lint(UNROOTED_MUST_ROOT, field.ty.span,
                                          "Type must be rooted, use #[must_root] on \
                                           the enum definition to propagate")
                         }
                     }
                 }
                 _ => () // Struct variants already caught by check_struct_def
@@ -130,17 +132,17 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> fo
             visit::FnKind::ItemFn(n, _, _, _, _, _, _) |
             visit::FnKind::Method(n, _, _, _) => {
                 &*n.as_str() == "new" || n.as_str().starts_with("new_")
             }
             visit::FnKind::Closure(_) => return,
         };
 
         if !in_derive_expn(cx, span) {
-            let def_id = cx.tcx.map.local_def_id(id);
+            let def_id = cx.tcx.hir.local_def_id(id);
             let ty = cx.tcx.item_type(def_id);
 
             for (arg, ty) in decl.inputs.iter().zip(ty.fn_args().0.iter()) {
                 if is_unrooted_ty(cx, ty, false) {
                     cx.span_lint(UNROOTED_MUST_ROOT, arg.span, "Type must be rooted")
                 }
             }
 
@@ -219,11 +221,11 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> 
         if let visit::FnKind::Closure(_) = kind {
             visit::walk_fn(self, kind, decl, body, span, id);
         }
     }
 
     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.map)
+        hir::intravisit::NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir)
     }
 }
--- a/servo/rust-nightly-date
+++ b/servo/rust-nightly-date
@@ -1,1 +1,1 @@
-2017-01-23
+2017-02-05