From 717b443eec9dac822d4599f93c723440f1c4ec9d Mon Sep 17 00:00:00 2001 From: Peter Date: Fri, 15 May 2015 16:27:07 -0400 Subject: [PATCH] fixes #6069 --- components/plugins/Cargo.toml | 4 ++-- components/plugins/lints/unrooted_must_root.rs | 8 ++++++-- components/servo/Cargo.lock | 6 +++--- ports/cef/Cargo.lock | 6 +++--- ports/gonk/Cargo.lock | 6 +++--- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/components/plugins/Cargo.toml b/components/plugins/Cargo.toml index 133bad303a5..946394fbe10 100644 --- a/components/plugins/Cargo.toml +++ b/components/plugins/Cargo.toml @@ -8,5 +8,5 @@ name = "plugins" path = "lib.rs" plugin = true -[dependencies.tenacious] -git = "https://github.com/Manishearth/rust-tenacious.git" \ No newline at end of file +[dependencies] +tenacious = "*" diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs index 7a39f6cc4d5..e819f8d0e4d 100644 --- a/components/plugins/lints/unrooted_must_root.rs +++ b/components/plugins/lints/unrooted_must_root.rs @@ -2,7 +2,7 @@ * 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/. */ -use syntax::{ast, codemap, visit}; +use syntax::{ast, codemap, visit, ast_map}; use syntax::attr::AttrMetaMethods; use rustc::lint::{Context, LintPass, LintArray}; use rustc::middle::ty::expr_ty; @@ -52,7 +52,11 @@ impl LintPass for UnrootedPass { } /// All structs containing #[must_root] types must be #[must_root] themselves fn check_struct_def(&mut self, cx: &Context, def: &ast::StructDef, _i: ast::Ident, _gen: &ast::Generics, id: ast::NodeId) { - if cx.tcx.map.expect_item(id).attrs.iter().all(|a| !a.check_name("must_root")) { + let item = match cx.tcx.map.get(id) { + ast_map::Node::NodeItem(item) => item, + _ => cx.tcx.map.expect_item(cx.tcx.map.get_parent(id)), + }; + if item.attrs.iter().all(|a| !a.check_name("must_root")) { for ref field in def.fields.iter() { lint_unrooted_ty(cx, &*field.node.ty, "Type must be rooted, use #[must_root] on the struct definition to propagate"); diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 3202bcf3859..03ba6d80a09 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -937,7 +937,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "plugins" version = "0.0.1" dependencies = [ - "tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", + "tenacious 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1185,8 +1185,8 @@ dependencies = [ [[package]] name = "tenacious" -version = "0.0.1" -source = "git+https://github.com/Manishearth/rust-tenacious.git#5112359cd36682cd7df3a7bb9a963299890be26c" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "time" diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index ce8b96337e1..041b4b2a25d 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -927,7 +927,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "plugins" version = "0.0.1" dependencies = [ - "tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", + "tenacious 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1178,8 +1178,8 @@ dependencies = [ [[package]] name = "tenacious" -version = "0.0.1" -source = "git+https://github.com/Manishearth/rust-tenacious.git#5112359cd36682cd7df3a7bb9a963299890be26c" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "time" diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 0a272d5fd01..1427e97c9c1 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -798,7 +798,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "plugins" version = "0.0.1" dependencies = [ - "tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", + "tenacious 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1048,8 +1048,8 @@ dependencies = [ [[package]] name = "tenacious" -version = "0.0.1" -source = "git+https://github.com/Manishearth/rust-tenacious.git#5112359cd36682cd7df3a7bb9a963299890be26c" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "time"