hir::PatIdent(_, _, None) |
hir::PatStruct(..) => {
match dm.get(&pat.id).map(|d| d.full_def()) {
- Some(DefVariant(..)) => true,
+ Some(Def::Variant(..)) => true,
_ => false
}
}
hir::PatIdent(_, _, None) |
hir::PatStruct(..) => {
match dm.get(&pat.id).map(|d| d.full_def()) {
- Some(DefVariant(..)) | Some(DefStruct(..)) => true,
+ Some(Def::Variant(..)) | Some(Def::Struct(..)) => true,
_ => false
}
}
match pat.node {
hir::PatIdent(_, _, None) | hir::PatEnum(..) | hir::PatQPath(..) => {
match dm.get(&pat.id).map(|d| d.full_def()) {
- Some(DefConst(..)) | Some(DefAssociatedConst(..)) => true,
+ Some(Def::Const(..)) | Some(Def::AssociatedConst(..)) => true,
_ => false
}
}
match dm.get(&pat.id)
.and_then(|d| if d.depth == 0 { Some(d.base_def) }
else { None } ) {
- Some(DefConst(..)) | Some(DefAssociatedConst(..)) => true,
+ Some(Def::Const(..)) | Some(Def::AssociatedConst(..)) => true,
_ => false
}
}
pub fn arm_contains_ref_binding(dm: &RefCell<DefMap>, arm: &hir::Arm) -> Option<hir::Mutability> {
arm.pats.iter()
.filter_map(|pat| pat_contains_ref_binding(dm, pat))
- .max_by(|m| match *m {
+ .max_by_key(|m| match *m {
hir::MutMutable => 1,
hir::MutImmutable => 0,
})
hir::PatIdent(_, _, None) |
hir::PatStruct(..) => {
match dm.get(&p.id) {
- Some(&PathResolution { base_def: DefVariant(_, id, _), .. }) => {
+ Some(&PathResolution { base_def: Def::Variant(_, id), .. }) => {
variants.push(id);
}
_ => ()