mirror of
https://github.com/servo/servo.git
synced 2025-06-11 01:50:10 +00:00
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.
This commit is contained in:
parent
27a2bb1582
commit
a5d9d0b32d
4 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue