aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_plugins/lib.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-11-02 15:08:04 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-11-02 15:08:04 +0100
commita5d9d0b32d28be603d14dcfc7ea3e5fdb87e25df (patch)
tree635a9bb87e2ee7006e45c3ca5fd73ada6e4a48cb /components/script_plugins/lib.rs
parent27a2bb1582ad2fe11ab7b14f2ac75e6f6f223c84 (diff)
downloadservo-a5d9d0b32d28be603d14dcfc7ea3e5fdb87e25df.tar.gz
servo-a5d9d0b32d28be603d14dcfc7ea3e5fdb87e25df.zip
Make the unrooted_must_root conditional on a default Cargo feature.
Only http://perf.rust-lang.org/ will disable it, in order to be less subject to changes to rustc internal APIs.
Diffstat (limited to 'components/script_plugins/lib.rs')
-rw-r--r--components/script_plugins/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs
index a929f394c21..3f256fdf11c 100644
--- a/components/script_plugins/lib.rs
+++ b/components/script_plugins/lib.rs
@@ -14,27 +14,35 @@
//! Use this for structs that correspond to a DOM type
+
#![deny(unsafe_code)]
#![feature(macro_vis_matcher)]
#![feature(plugin)]
#![feature(plugin_registrar)]
#![feature(rustc_private)]
+#[cfg(feature = "unrooted_must_root_lint")]
#[macro_use]
extern crate rustc;
+
extern crate rustc_plugin;
extern crate syntax;
use rustc_plugin::Registry;
use syntax::feature_gate::AttributeType::Whitelisted;
+#[cfg(feature = "unrooted_must_root_lint")]
mod unrooted_must_root;
+
/// Utilities for writing plugins
+#[cfg(feature = "unrooted_must_root_lint")]
mod utils;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
+ #[cfg(feature = "unrooted_must_root_lint")]
reg.register_late_lint_pass(Box::new(unrooted_must_root::UnrootedPass::new()));
+
reg.register_attribute("allow_unrooted_interior".to_string(), Whitelisted);
reg.register_attribute("must_root".to_string(), Whitelisted);
}