// build a map from pattern identifiers to binding-info's.
// this is done hygienically. This could arise for a macro
// that expands into an or-pattern where one 'x' was from the
// user and one 'x' came from the macro.
build a map from pattern identifiers to binding-info's.
this is done hygienically. This could arise for a macro
that expands into an or-pattern where one 'x' was from the
user and one 'x' came from the macro.
build a map from pattern identifiers to binding - info ' s . this is done hygienically . This could arise for a macro that expands into an or - pattern where one ' x ' was from the user and one ' x ' came from the macro .
fn binding_mode_map(&mut self, pat: &Pat) -> BindingMap {
        let mut binding_map = HashMap::new();
        pat.walk(&mut |pat| {
            if let PatKind::Ident(binding_mode, ident, ref sub_pat) = pat.node {
                if sub_pat.is_some() || match self.def_map.get(&pat.id) {
                    Some(&PathResolution { base_def: Def::Local(..), .. }) => true,
                    _ => false,
                } {
                    let binding_info = BindingInfo { span: ident.span, binding_mode: binding_mode };
                    binding_map.insert(ident.node, binding_info);
                }
            }
            true
        });
        binding_map
    }
fn binding_mode_map ( & mut self , pat : & Pat ) -> BindingMap { let mut binding_map = HashMap :: new ( ) ; pat . walk ( & mut | pat | { if let PatKind :: Ident ( binding_mode , ident , ref sub_pat ) = pat . node { if sub_pat . is_some ( ) || match self . def_map . get ( & pat . id ) { Some ( & PathResolution { base_def : Def :: Local ( .. ) , .. } ) => true , _ => false , } { let binding_info = BindingInfo { span : ident . span , binding_mode : binding_mode } ; binding_map . insert ( ident . node , binding_info ) ; } } true } ) ; binding_map }
build a map from pattern identifiers to binding-info's.
build a map from pattern identifiers to binding - info ' s .
&mut self
pat
&Pat