mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Update to rustc 1.16.0-nightly (4ecc85beb 2016-12-28)
This commit is contained in:
parent
e995af9cff
commit
37923f6f2a
3 changed files with 14 additions and 8 deletions
|
@ -23,10 +23,16 @@ pub fn match_ty_unwrap<'a>(ty: &'a ast::Ty, segments: &[&str]) -> Option<&'a [P<
|
|||
// which will compare them in reverse until one of them runs out of segments
|
||||
if seg.iter().rev().zip(segments.iter().rev()).all(|(a, b)| &*a.identifier.name.as_str() == *b) {
|
||||
match seg.last() {
|
||||
Some(&ast::PathSegment { parameters: ast::PathParameters::AngleBracketed(ref a), .. }) => {
|
||||
Some(&a.types)
|
||||
Some(&ast::PathSegment { parameters: Some(ref params), .. }) => {
|
||||
match **params {
|
||||
ast::PathParameters::AngleBracketed(ref a) => Some(&a.types),
|
||||
|
||||
// `Foo(A,B) -> C`
|
||||
ast::PathParameters::Parenthesized(_) => None,
|
||||
}
|
||||
}
|
||||
_ => None
|
||||
Some(&ast::PathSegment { parameters: None, .. }) => Some(&[]),
|
||||
None => None,
|
||||
}
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue