mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Upgrade to rustc 1.36.0-nightly (a9ec99f42 2019-05-13)
This commit is contained in:
parent
3ca9d143af
commit
06b99983fc
5 changed files with 131 additions and 43 deletions
|
@ -29,6 +29,7 @@ extern crate webidl;
|
|||
|
||||
use rustc_plugin::Registry;
|
||||
use syntax::feature_gate::AttributeType::Whitelisted;
|
||||
use syntax::symbol::Symbol;
|
||||
|
||||
#[cfg(feature = "unrooted_must_root_lint")]
|
||||
mod unrooted_must_root;
|
||||
|
@ -42,14 +43,61 @@ mod utils;
|
|||
|
||||
#[plugin_registrar]
|
||||
pub fn plugin_registrar(reg: &mut Registry) {
|
||||
let symbols = crate::Symbols::new();
|
||||
|
||||
#[cfg(feature = "unrooted_must_root_lint")]
|
||||
reg.register_late_lint_pass(Box::new(unrooted_must_root::UnrootedPass::new()));
|
||||
reg.register_late_lint_pass(Box::new(unrooted_must_root::UnrootedPass::new(
|
||||
symbols.clone(),
|
||||
)));
|
||||
|
||||
#[cfg(feature = "webidl_lint")]
|
||||
reg.register_late_lint_pass(Box::new(webidl_must_inherit::WebIdlPass::new()));
|
||||
reg.register_late_lint_pass(Box::new(webidl_must_inherit::WebIdlPass::new(
|
||||
symbols.clone(),
|
||||
)));
|
||||
|
||||
reg.register_attribute("allow_unrooted_interior".to_string(), Whitelisted);
|
||||
reg.register_attribute("allow_unrooted_in_rc".to_string(), Whitelisted);
|
||||
reg.register_attribute("must_root".to_string(), Whitelisted);
|
||||
reg.register_attribute("webidl".to_string(), Whitelisted);
|
||||
reg.register_attribute(symbols.allow_unrooted_interior, Whitelisted);
|
||||
reg.register_attribute(symbols.allow_unrooted_in_rc, Whitelisted);
|
||||
reg.register_attribute(symbols.must_root, Whitelisted);
|
||||
reg.register_attribute(symbols.webidl, Whitelisted);
|
||||
}
|
||||
|
||||
macro_rules! symbols {
|
||||
($($s: ident)+) => {
|
||||
#[derive(Clone)]
|
||||
#[allow(non_snake_case)]
|
||||
struct Symbols {
|
||||
$( $s: Symbol, )+
|
||||
}
|
||||
|
||||
impl Symbols {
|
||||
fn new() -> Self {
|
||||
Symbols {
|
||||
$( $s: Symbol::intern(stringify!($s)), )+
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
symbols! {
|
||||
allow_unrooted_interior
|
||||
allow_unrooted_in_rc
|
||||
must_root
|
||||
webidl
|
||||
alloc
|
||||
rc
|
||||
Rc
|
||||
cell
|
||||
Ref
|
||||
RefMut
|
||||
slice
|
||||
Iter
|
||||
IterMut
|
||||
collections
|
||||
hash
|
||||
map
|
||||
set
|
||||
Entry
|
||||
OccupiedEntry
|
||||
VacantEntry
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue