Rustup to *rustc 1.13.0-nightly (f1f40f850 2016-09-09)*

This commit is contained in:
mcarton
2016-09-09 20:24:20 +02:00
parent b08c7aa553
commit ab6669a641
8 changed files with 17 additions and 21 deletions

View File

@@ -152,11 +152,10 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool {
apb.names == path
}
/// Check if type is struct or enum type with given def path.
/// Check if type is struct, enum or union type with given def path.
pub fn match_type(cx: &LateContext, ty: ty::Ty, path: &[&str]) -> bool {
match ty.sty {
ty::TyEnum(adt, _) |
ty::TyStruct(adt, _) => match_def_path(cx, adt.did, path),
ty::TyAdt(adt, _) => match_def_path(cx, adt.did, path),
_ => false,
}
}