diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2019-05-14 14:39:23 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2019-05-14 17:37:40 +0200 |
commit | 06b99983fce8e83d8c5c0a3d12e3587a25698b10 (patch) | |
tree | d901a4125a7869f3fb24cbabf38529df5fe7ca8a /components/script_plugins/utils.rs | |
parent | 3ca9d143afdaab0986c1fa87df546224b6cce5be (diff) | |
download | servo-06b99983fce8e83d8c5c0a3d12e3587a25698b10.tar.gz servo-06b99983fce8e83d8c5c0a3d12e3587a25698b10.zip |
Upgrade to rustc 1.36.0-nightly (a9ec99f42 2019-05-13)
Diffstat (limited to 'components/script_plugins/utils.rs')
-rw-r--r-- | components/script_plugins/utils.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script_plugins/utils.rs b/components/script_plugins/utils.rs index c580879ebd8..e6398de35e1 100644 --- a/components/script_plugins/utils.rs +++ b/components/script_plugins/utils.rs @@ -5,11 +5,12 @@ use rustc::hir::def_id::DefId; use rustc::lint::LateContext; use syntax::source_map::{ExpnFormat, Span}; +use syntax::symbol::Symbol; /// check if a DefId's path matches the given absolute type path /// usage e.g. with /// `match_def_path(cx, id, &["core", "option", "Option"])` -pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool { +pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool { let krate = &cx.tcx.crate_name(def_id.krate); if krate != &path[0] { return false; @@ -24,9 +25,8 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool { other .into_iter() - .map(|e| e.data) .zip(path) - .all(|(nm, p)| &*nm.as_interned_str().as_str() == *p) + .all(|(e, p)| e.data.as_interned_str().as_symbol() == *p) } pub fn in_derive_expn(span: Span) -> bool { |