mirror of
https://github.com/servo/servo.git
synced 2025-06-09 00:53:26 +00:00
Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19.
This commit is contained in:
parent
cf616b90a2
commit
16c7060bc8
153 changed files with 2095 additions and 1298 deletions
|
@ -4,7 +4,6 @@
|
|||
|
||||
use rustc::lint::Context;
|
||||
use rustc::middle::{ty, def};
|
||||
use rustc::middle::typeck::astconv::AstConv;
|
||||
|
||||
use syntax::ptr::P;
|
||||
use syntax::{ast, ast_map};
|
||||
|
@ -17,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
|
||||
|
@ -40,7 +39,7 @@ 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 mut found = false;
|
||||
if let TyPath(_, _, ty_id) = ty.node {
|
||||
if let TyPath(_, ty_id) = ty.node {
|
||||
if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().get(&ty_id).cloned() {
|
||||
// Iterating through attributes is hard because of cross-crate defs
|
||||
ty::each_attr(cx.tcx, def_id, |attr| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue