diff options
Diffstat (limited to 'components/script_plugins/unrooted_must_root.rs')
-rw-r--r-- | components/script_plugins/unrooted_must_root.rs | 6 |
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, |