@@ -718,8 +718,7 @@ impl TypedAstContext {
718718 pub fn unwrap_cast_expr ( & self , mut expr_id : CExprId ) -> CExprId {
719719 while let CExprKind :: Paren ( _, subexpr)
720720 | CExprKind :: ImplicitCast ( _, subexpr, _, _, _)
721- | CExprKind :: ExplicitCast ( _, subexpr, _, _, _) =
722- self . index_unwrap_parens ( expr_id) . kind
721+ | CExprKind :: ExplicitCast ( _, subexpr, _, _, _) = self [ expr_id] . kind
723722 {
724723 expr_id = subexpr;
725724 }
@@ -741,7 +740,7 @@ impl TypedAstContext {
741740 /// Resolve true expression type, iterating through any casts and variable
742741 /// references.
743742 pub fn resolve_expr_type_id ( & self , expr_id : CExprId ) -> Option < ( CExprId , CTypeId ) > {
744- let expr = & self . index_unwrap_parens ( expr_id) . kind ;
743+ let expr = & self [ expr_id] . kind ;
745744 let mut ty = expr. get_type ( ) ;
746745 use CExprKind :: * ;
747746 match expr {
@@ -885,7 +884,7 @@ impl TypedAstContext {
885884 pub fn is_expr_pure ( & self , expr : CExprId ) -> bool {
886885 use CExprKind :: * ;
887886 let pure = |expr| self . is_expr_pure ( expr) ;
888- match self . index_unwrap_parens ( expr) . kind {
887+ match self [ expr] . kind {
889888 BadExpr |
890889 ShuffleVector ( ..) |
891890 ConvertVector ( ..) |
@@ -957,7 +956,7 @@ impl TypedAstContext {
957956 let is_const = |expr| self . is_const_expr ( expr) ;
958957
959958 use CExprKind :: * ;
960- match self . index_unwrap_parens ( expr) . kind {
959+ match self [ expr] . kind {
961960 // A literal is always `const`.
962961 Literal ( _, _) => true ,
963962 // Unary ops should be `const`.
@@ -1271,7 +1270,7 @@ impl TypedAstContext {
12711270 _ => return ,
12721271 } ;
12731272
1274- let new_ty = match self . ast_context . c_exprs [ & e] . kind {
1273+ let new_ty = match self . ast_context [ e] . kind {
12751274 CExprKind :: Conditional ( _ty, _cond, lhs, rhs) => {
12761275 let lhs_type_id =
12771276 self . ast_context . c_exprs [ & lhs] . kind . get_qual_type ( ) . unwrap ( ) ;
0 commit comments