Bump to Rust 2016-02-22

This commit is contained in:
Anthony Ramine 2016-02-22 18:22:41 +01:00
parent ef95eb3bbe
commit dab9b4700c
12 changed files with 465 additions and 413 deletions

View file

@ -18,7 +18,7 @@ use syntax::ptr::P;
/// 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 ast::Ty, segments: &[&str]) -> Option<&'a [P<ast::Ty>]> {
match ty.node {
ast::TyPath(_, ast::Path { segments: ref seg, .. }) => {
ast::TyKind::Path(_, ast::Path { segments: ref seg, .. }) => {
// So hir::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
@ -60,9 +60,9 @@ pub fn match_lang_ty(cx: &LateContext, ty: &hir::Ty, value: &str) -> bool {
pub fn match_lang_did(cx: &LateContext, 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" => {
ast::MetaItemKind::NameValue(ref name, ref val) if &**name == "servo_lang" => {
match val.node {
ast::LitStr(ref v, _) if &**v == value => {
ast::LitKind::Str(ref v, _) if &**v == value => {
mark_used(attr);
true
},