Update to rustc 1.16.0-nightly (4ecc85beb 2016-12-28)

This commit is contained in:
Simon Sapin 2016-12-23 16:24:06 +01:00
parent e995af9cff
commit 37923f6f2a
3 changed files with 14 additions and 8 deletions

View file

@ -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