aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_plugins
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-10-26 12:57:14 +0200
committerSimon Sapin <simon.sapin@exyr.org>2019-10-26 13:03:49 +0200
commitd3439fb4d105c1b772b45969f25bff8071d46cad (patch)
treef890023afa27aaf0a3df8c0394dd115faf07518c /components/script_plugins
parent642b8b041567016c0ad3f6f4342c68a2fcd35daa (diff)
downloadservo-d3439fb4d105c1b772b45969f25bff8071d46cad.tar.gz
servo-d3439fb4d105c1b772b45969f25bff8071d46cad.zip
Upgrade to rustc 1.40.0-nightly (246be7e1a 2019-10-25)
Diffstat (limited to 'components/script_plugins')
-rw-r--r--components/script_plugins/lib.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs
index ea00a58848d..740ae9f35ad 100644
--- a/components/script_plugins/lib.rs
+++ b/components/script_plugins/lib.rs
@@ -27,7 +27,7 @@ extern crate syntax;
use rustc::hir::def_id::DefId;
use rustc::hir::intravisit as visit;
use rustc::hir::{self, ExprKind, HirId};
-use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
+use rustc::lint::{LateContext, LateLintPass, LintContext, LintPass};
use rustc::ty;
use rustc_driver::plugin::Registry;
use syntax::feature_gate::AttributeType::Whitelisted;
@@ -36,13 +36,20 @@ use syntax::source_map::{ExpnKind, MacroKind, Span};
use syntax::symbol::sym;
use syntax::symbol::Symbol;
+#[allow(deprecated)]
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
+ registrar(reg)
+}
+
+fn registrar(reg: &mut Registry) {
let symbols = Symbols::new();
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_late_lint_pass(Box::new(UnrootedPass::new(symbols)));
+ reg.lint_store.register_lints(&[&UNROOTED_MUST_ROOT]);
+ reg.lint_store
+ .register_late_pass(move || Box::new(UnrootedPass::new(symbols.clone())));
}
declare_lint!(
@@ -165,10 +172,6 @@ impl LintPass for UnrootedPass {
fn name(&self) -> &'static str {
"ServoUnrootedPass"
}
-
- fn get_lints(&self) -> LintArray {
- lint_array!(UNROOTED_MUST_ROOT)
- }
}
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
@@ -360,7 +363,7 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool {
other
.into_iter()
.zip(path)
- .all(|(e, p)| e.data.as_interned_str().as_symbol() == *p)
+ .all(|(e, p)| e.data.as_symbol() == *p)
}
fn in_derive_expn(span: Span) -> bool {