pub fn pat_is_resolved_const(dm: &DefMap, pat: &hir::Pat) -> bool {
    match pat.node {
        PatKind::Path(..) | PatKind::QPath(..) => {
            match dm.get(&pat.id)
                    .and_then(|d| if d.depth == 0 { Some(d.base_def) }
                                  else { None } ) {
                Some(Def::Const(..)) | Some(Def::AssociatedConst(..)) => true,
                _ => false
            }
        }
        _ => false
    }
}
// Same as above, except that partially-resolved defs cause `false` to be
// returned instead of a panic.
Same as above, except that partially-resolved defs cause `false` to be
returned instead of a panic.
Same as above except that partially - resolved defs cause ` false ` to be returned instead of a panic .
pub fn pat_is_resolved_const(dm: &DefMap, pat: &hir::Pat) -> bool {
    match pat.node {
        PatKind::Path(..) | PatKind::QPath(..) => {
            match dm.get(&pat.id)
                    .and_then(|d| if d.depth == 0 { Some(d.base_def) }
                                  else { None } ) {
                Some(Def::Const(..)) | Some(Def::AssociatedConst(..)) => true,
                _ => false
            }
        }
        _ => false
    }
}
pub fn pat_is_resolved_const ( dm : & DefMap , pat : & hir :: Pat ) -> bool { match pat . node { PatKind :: Path ( .. ) | PatKind :: QPath ( .. ) => { match dm . get ( & pat . id ) . and_then ( | d | if d . depth == 0 { Some ( d . base_def ) } else { None } ) { Some ( Def :: Const ( .. ) ) | Some ( Def :: AssociatedConst ( .. ) ) => true , _ => false } } _ => false } }
Same as above, except that partially-resolved defs cause `false` to be
returned instead of a panic.
Same as above except that partially - resolved defs cause ` false ` to be returned instead of a panic .
dm
&DefMap
pat
&hir::Pat
dm
&DefMap
pat
&hir::Pat