From 63714ebc5f41015876f3e3416a82eb99beec5e6b Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 26 Apr 2015 22:54:34 +0530 Subject: [PATCH] Add the rust-tenacious move-protection lint, use it for `Root` (fixes #5724) --- components/plugins/Cargo.toml | 3 +++ components/plugins/lib.rs | 3 +++ components/script/dom/bindings/js.rs | 1 + ports/cef/Cargo.lock | 8 ++++++++ ports/gonk/Cargo.lock | 8 ++++++++ 5 files changed, 23 insertions(+) diff --git a/components/plugins/Cargo.toml b/components/plugins/Cargo.toml index 38099fc5677..133bad303a5 100644 --- a/components/plugins/Cargo.toml +++ b/components/plugins/Cargo.toml @@ -7,3 +7,6 @@ authors = ["The Servo Project Developers"] name = "plugins" path = "lib.rs" plugin = true + +[dependencies.tenacious] +git = "https://github.com/Manishearth/rust-tenacious.git" \ No newline at end of file diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs index 968676b5413..36045cec078 100644 --- a/components/plugins/lib.rs +++ b/components/plugins/lib.rs @@ -19,6 +19,8 @@ extern crate syntax; #[macro_use] extern crate rustc; +extern crate tenacious; + use rustc::lint::LintPassObject; use rustc::plugin::Registry; use syntax::ext::base::{Decorator, Modifier}; @@ -48,4 +50,5 @@ pub fn plugin_registrar(reg: &mut Registry) { reg.register_lint_pass(box lints::inheritance_integrity::InheritancePass as LintPassObject); reg.register_lint_pass(box lints::str_to_string::StrToStringPass as LintPassObject); reg.register_lint_pass(box lints::ban::BanPass as LintPassObject); + reg.register_lint_pass(box tenacious::TenaciousPass as LintPassObject); } diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 80eb1317f32..347f32a266e 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -626,6 +626,7 @@ impl RootCollection { /// for the same JS value. `Root`s cannot outlive the associated /// `RootCollection` object. Attempts to transfer ownership of a `Root` via /// moving will trigger dynamic unrooting failures due to incorrect ordering. +#[no_move] pub struct Root { /// List that ensures correct dynamic root ordering root_list: &'static RootCollection, diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index eca0ca7f0b3..fbed3047db7 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -759,6 +759,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "plugins" version = "0.0.1" +dependencies = [ + "tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", +] [[package]] name = "pnacl-build-helper" @@ -960,6 +963,11 @@ dependencies = [ name = "task_info" version = "0.0.1" +[[package]] +name = "tenacious" +version = "0.0.1" +source = "git+https://github.com/Manishearth/rust-tenacious.git#f47093c600b8cc1b29f89759eea6c18920584f71" + [[package]] name = "text_writer" version = "0.1.9" diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index f2bb8c7c3c0..e04d47b9582 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -751,6 +751,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "plugins" version = "0.0.1" +dependencies = [ + "tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", +] [[package]] name = "pnacl-build-helper" @@ -951,6 +954,11 @@ dependencies = [ name = "task_info" version = "0.0.1" +[[package]] +name = "tenacious" +version = "0.0.1" +source = "git+https://github.com/Manishearth/rust-tenacious.git#f47093c600b8cc1b29f89759eea6c18920584f71" + [[package]] name = "text_writer" version = "0.1.9"