pub(super) fn find_anon_type(
        &self,
        region: Region<'tcx>,
        br: &ty::BoundRegion,
    ) -> Option<(&hir::Ty, &hir::FnDecl)> {
        if let Some(anon_reg) = self.is_suitable_region(region) {
            let def_id = anon_reg.def_id;
            if let Some(node_id) = self.tcx.hir.as_local_node_id(def_id) {
                let fndecl = match self.tcx.hir.get(node_id) {
                    Node::Item(&hir::Item {
                        node: hir::ItemKind::Fn(ref fndecl, ..),
                        ..
                    }) => &fndecl,
                    Node::TraitItem(&hir::TraitItem {
                        node: hir::TraitItemKind::Method(ref m, ..),
                        ..
                    })
                    | Node::ImplItem(&hir::ImplItem {
                        node: hir::ImplItemKind::Method(ref m, ..),
                        ..
                    }) => &m.decl,
                    _ => return None,
                };

                return fndecl
                    .inputs
                    .iter()
                    .filter_map(|arg| self.find_component_for_bound_region(arg, br))
                    .next()
                    .map(|ty| (ty, &**fndecl));
            }
        }
        None
    }
/// This function calls the `visit_ty` method for the parameters
/// corresponding to the anonymous regions. The `nested_visitor.found_type`
/// contains the anonymous type.
///
/// # Arguments
/// region - the anonymous region corresponding to the anon_anon conflict
/// br - the bound region corresponding to the above region which is of type `BrAnon(_)`
///
/// # Example
/// ```
/// fn foo(x: &mut Vec<&u8>, y: &u8)
///    { x.push(y); }
/// ```
/// The function returns the nested type corresponding to the anonymous region
/// for e.g. `&u8` and Vec<`&u8`.
This function calls the `visit_ty` method for the parameters
corresponding to the anonymous regions.
This function calls the ` visit_ty ` method for the parameters corresponding to the anonymous regions .
pub(super) fn find_anon_type(
        &self,
        region: Region<'tcx>,
        br: &ty::BoundRegion,
    ) -> Option<(&hir::Ty, &hir::FnDecl)> {
        if let Some(anon_reg) = self.is_suitable_region(region) {
            let def_id = anon_reg.def_id;
            if let Some(node_id) = self.tcx.hir.as_local_node_id(def_id) {
                let fndecl = match self.tcx.hir.get(node_id) {
                    Node::Item(&hir::Item {
                        node: hir::ItemKind::Fn(ref fndecl, ..),
                        ..
                    }) => &fndecl,
                    Node::TraitItem(&hir::TraitItem {
                        node: hir::TraitItemKind::Method(ref m, ..),
                        ..
                    })
                    | Node::ImplItem(&hir::ImplItem {
                        node: hir::ImplItemKind::Method(ref m, ..),
                        ..
                    }) => &m.decl,
                    _ => return None,
                };
                return fndecl
                    .inputs
                    .iter()
                    .filter_map(|arg| self.find_component_for_bound_region(arg, br))
                    .next()
                    .map(|ty| (ty, &**fndecl));
            }
        }
        None
    }
pub ( super ) fn find_anon_type ( & self , region : Region < ' tcx > , br : & ty :: BoundRegion , ) -> Option < ( & hir :: Ty , & hir :: FnDecl ) > { if let Some ( anon_reg ) = self . is_suitable_region ( region ) { let def_id = anon_reg . def_id ; if let Some ( node_id ) = self . tcx . hir . as_local_node_id ( def_id ) { let fndecl = match self . tcx . hir . get ( node_id ) { Node :: Item ( & hir :: Item { node : hir :: ItemKind :: Fn ( ref fndecl , .. ) , .. } ) => & fndecl , Node :: TraitItem ( & hir :: TraitItem { node : hir :: TraitItemKind :: Method ( ref m , .. ) , .. } ) | Node :: ImplItem ( & hir :: ImplItem { node : hir :: ImplItemKind :: Method ( ref m , .. ) , .. } ) => & m . decl , _ => return None , } ; return fndecl . inputs . iter ( ) . filter_map ( | arg | self . find_component_for_bound_region ( arg , br ) ) . next ( ) . map ( | ty | ( ty , & * * fndecl ) ) ; } } None }
This function calls the `visit_ty` method for the parameters
corresponding to the anonymous regions.
This function calls the ` visit_ty ` method for the parameters corresponding to the anonymous regions .
&self
region
Region<'tcx>
br
&ty::BoundRegion
&self
region
Region<'tcx>
br
&ty::BoundRegion
example
```
fn foo(x: &mut Vec<&u8>, y: &u8)
{ x.push(y); }
```
The function returns the nested type corresponding to the anonymous region
for e.g.
` ` ` fn foo ( x : &mut Vec<&u8 > y : &u8 ) { x . push ( y ) ; } ` ` ` The function returns the nested type corresponding to the anonymous region for e . g .