aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_plugins/unrooted_must_root.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-06-24 12:22:28 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-07-07 12:53:39 +0200
commita09899be99747018cd6622a7da59a1d3045f36bf (patch)
tree8b0942df973aabee3bd04479b956e219179d2394 /components/script_plugins/unrooted_must_root.rs
parent1b9d8fa674115dabdddbfd47acbc9a9e336b8ed4 (diff)
downloadservo-a09899be99747018cd6622a7da59a1d3045f36bf.tar.gz
servo-a09899be99747018cd6622a7da59a1d3045f36bf.zip
Upgrade to rustc 1.29.0-nightly (e06c87544 2018-07-06)
Diffstat (limited to 'components/script_plugins/unrooted_must_root.rs')
-rw-r--r--components/script_plugins/unrooted_must_root.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script_plugins/unrooted_must_root.rs b/components/script_plugins/unrooted_must_root.rs
index 1c347897b91..29e74940536 100644
--- a/components/script_plugins/unrooted_must_root.rs
+++ b/components/script_plugins/unrooted_must_root.rs
@@ -7,7 +7,7 @@ use rustc::hir::intravisit as visit;
use rustc::hir::map as ast_map;
use rustc::lint::{LateContext, LintPass, LintArray, LateLintPass, LintContext};
use rustc::ty;
-use syntax::{ast, codemap};
+use syntax::{ast, codemap, symbol::Ident};
use utils::{match_def_path, in_derive_expn};
declare_lint!(UNROOTED_MUST_ROOT, Deny,
@@ -133,8 +133,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
span: codemap::Span,
id: ast::NodeId) {
let in_new_function = match kind {
- visit::FnKind::ItemFn(n, _, _, _, _, _, _) |
- visit::FnKind::Method(n, _, _, _) => {
+ visit::FnKind::ItemFn(n, _, _, _, _) |
+ visit::FnKind::Method(Ident { name: n, .. }, _, _, _) => {
&*n.as_str() == "new" || n.as_str().starts_with("new_")
}
visit::FnKind::Closure(_) => return,