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
}
}
}
/// Checks if the pattern contains any `ref` or `ref mut` bindings,
-/// and if yes wether its containing mutable ones or just immutables ones.
+/// and if yes whether its containing mutable ones or just immutables ones.
pub fn pat_contains_ref_binding(dm: &RefCell<DefMap>, pat: &hir::Pat) -> Option<hir::Mutability> {
let mut result = None;
pat_bindings(dm, pat, |mode, _, _, _| {
}
/// Checks if the patterns for this arm contain any `ref` or `ref mut`
-/// bindings, and if yes wether its containing mutable ones or just immutables ones.
+/// bindings, and if yes whether its containing mutable ones or just immutables ones.
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))
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);
}
_ => ()