diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-03-11 11:08:57 +0100 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2015-03-18 13:18:31 -0400 |
commit | 5f15eb5fbfb7a8649132cc8b3a07314389836714 (patch) | |
tree | cc36210329cb1a31709a03685c05c4aaa99407e3 /components/plugins/utils.rs | |
parent | 65d4b12bf20783ea784f1c61f4b33ec0fc975f4f (diff) | |
download | servo-5f15eb5fbfb7a8649132cc8b3a07314389836714.tar.gz servo-5f15eb5fbfb7a8649132cc8b3a07314389836714.zip |
Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.
Diffstat (limited to 'components/plugins/utils.rs')
-rw-r--r-- | components/plugins/utils.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs index 0bc146186be..6c1d7e38268 100644 --- a/components/plugins/utils.rs +++ b/components/plugins/utils.rs @@ -16,7 +16,7 @@ use syntax::attr::mark_used; /// Try not to use this for types defined in crates you own, use match_lang_ty instead (for lint passes) pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]> { match ty.node { - TyPath(Path {segments: ref seg, ..}, _) => { + TyPath(_, Path {segments: ref seg, ..}) => { // So ast::Path isn't the full path, just the tokens that were provided. // I could muck around with the maps and find the full path // however the more efficient way is to simply reverse the iterators and zip them @@ -38,13 +38,13 @@ pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]> /// Checks if a type has a #[servo_lang = "str"] attribute pub fn match_lang_ty(cx: &Context, ty: &Ty, value: &str) -> bool { - let ty_id = match ty.node { - TyPath(_, ty_id) => ty_id, + match ty.node { + TyPath(..) => {}, _ => return false, - }; + } - let def_id = match cx.tcx.def_map.borrow().get(&ty_id).cloned() { - Some(def::DefTy(def_id, _)) => def_id, + let def_id = match cx.tcx.def_map.borrow().get(&ty.id) { + Some(&def::PathResolution { base_def: def::DefTy(def_id, _), .. }) => def_id, _ => return false, }; |