/// Search for references to the given declaration in a value position
/// inside the given expression. Uses of the declaration inside typeof
/// operations are ignored because our translation will ignore them
/// and use the computed types instead.
Search for references to the given declaration in a value position
inside the given expression. Uses of the declaration inside typeof
operations are ignored because our translation will ignore them
and use the computed types instead.
Search for references to the given declaration in a value position inside the given expression . Uses of the declaration inside typeof operations are ignored because our translation will ignore them and use the computed types instead .
fn has_decl_reference(&self, decl_id: CDeclId, expr_id: CExprId) -> bool {
        let mut iter = DFExpr::new(&self.ast_context, expr_id.into());
        while let Some(x) = iter.next() {
            match x {
                SomeId::Expr(e) => {
                    match self.ast_context[e].kind {
                        CExprKind::DeclRef(_, d) if d == decl_id => return true,
                        CExprKind::UnaryType(_, _, Some(_), _) => iter.prune(1),
                        _ => {}
                    }
                }
                SomeId::Type(t) => {
                    if let CTypeKind::TypeOfExpr(_) = self.ast_context[t].kind {
                        iter.prune(1);
                    }
                }
                _ => {}
            }
        }
        false
    }
fn has_decl_reference ( & self , decl_id : CDeclId , expr_id : CExprId ) -> bool { let mut iter = DFExpr :: new ( & self . ast_context , expr_id . into ( ) ) ; while let Some ( x ) = iter . next ( ) { match x { SomeId :: Expr ( e ) => { match self . ast_context [ e ] . kind { CExprKind :: DeclRef ( _ , d ) if d == decl_id => return true , CExprKind :: UnaryType ( _ , _ , Some ( _ ) , _ ) => iter . prune ( 1 ) , _ => { } } } SomeId :: Type ( t ) => { if let CTypeKind :: TypeOfExpr ( _ ) = self . ast_context [ t ] . kind { iter . prune ( 1 ) ; } } _ => { } } } false }
Search for references to the given declaration in a value position
inside the given expression.
Search for references to the given declaration in a value position inside the given expression .
&self
decl_id
CDeclId
expr_id
CExprId