diff options
-rw-r--r-- | components/script_plugins/unrooted_must_root.rs | 6 | ||||
-rw-r--r-- | components/script_plugins/utils.rs | 2 | ||||
-rw-r--r-- | rust-toolchain | 2 |
3 files changed, 5 insertions, 5 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, diff --git a/components/script_plugins/utils.rs b/components/script_plugins/utils.rs index 9199e5b083b..92797f81430 100644 --- a/components/script_plugins/utils.rs +++ b/components/script_plugins/utils.rs @@ -30,7 +30,7 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool { pub fn in_derive_expn(span: Span) -> bool { if let Some(i) = span.ctxt().outer().expn_info() { - if let ExpnFormat::MacroAttribute(n) = i.callee.format { + if let ExpnFormat::MacroAttribute(n) = i.format { n.as_str().contains("derive") } else { false diff --git a/rust-toolchain b/rust-toolchain index efeae5ba310..7888624d5e7 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2018-06-13 +nightly-2018-07-07 |