diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-09-02 07:57:55 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2015-09-02 09:22:17 +0200 |
commit | 40b4348824f96a0f37b39f38a024b6061b36b0a7 (patch) | |
tree | 0c7b91cac0e789c3d53bf11fcda475037f1de0e5 /components/plugins/utils.rs | |
parent | ba2cb77c26006dc378553d757e88de8ab86c4d5b (diff) | |
download | servo-40b4348824f96a0f37b39f38a024b6061b36b0a7.tar.gz servo-40b4348824f96a0f37b39f38a024b6061b36b0a7.zip |
Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)
Diffstat (limited to 'components/plugins/utils.rs')
-rw-r--r-- | components/plugins/utils.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs index e26cc4bc7cd..580cfe9efc5 100644 --- a/components/plugins/utils.rs +++ b/components/plugins/utils.rs @@ -5,6 +5,7 @@ use rustc::ast_map; use rustc::lint::Context; use rustc::middle::def; +use rustc::middle::def_id::DefId; use syntax::ast; use syntax::ast::{TyPath, Path, AngleBracketedParameters, PathSegment, Ty}; @@ -52,7 +53,7 @@ pub fn match_lang_ty(cx: &Context, ty: &Ty, value: &str) -> bool { match_lang_did(cx, def_id, value) } -pub fn match_lang_did(cx: &Context, did: ast::DefId, value: &str) -> bool { +pub fn match_lang_did(cx: &Context, did: DefId, value: &str) -> bool { cx.tcx.get_attrs(did).iter().any(|attr| { match attr.node.value.node { ast::MetaNameValue(ref name, ref val) if &**name == "servo_lang" => { @@ -96,7 +97,7 @@ pub fn unsafe_context(map: &ast_map::Map, id: ast::NodeId) -> bool { /// 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: &Context, def_id: ast::DefId, path: &[&str]) -> bool { +pub fn match_def_path(cx: &Context, def_id: DefId, path: &[&str]) -> bool { cx.tcx.with_path(def_id, |iter| iter.map(|elem| elem.name()) .zip(path.iter()).all(|(nm, p)| &nm.as_str() == p)) } |