File tree Expand file tree Collapse file tree
c2rust-transpile/src/c_ast Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2001,6 +2001,19 @@ impl ConversionContext {
20012001 self . expr_possibly_as_stmt ( expected_ty, new_id, node, e)
20022002 }
20032003
2004+ ASTEntryTag :: TagGenericExpr if expected_ty & ( EXPR | STMT ) != 0 => {
2005+ let wrapped = node. children [ 0 ] . expect ( "Expected generic expression" ) ;
2006+ let ty_old = node. type_id . expect ( "Expected expression to have type" ) ;
2007+ let ty = self . visit_qualified_type ( ty_old) ;
2008+
2009+ // Use the existing `Paren` kind instead of adding a new one
2010+ // that would just be a no-op wrapper around the inner
2011+ // expression
2012+ let expr = CExprKind :: Paren ( ty, self . visit_expr ( wrapped) ) ;
2013+
2014+ self . expr_possibly_as_stmt ( expected_ty, new_id, node, expr) ;
2015+ }
2016+
20042017 // Declarations
20052018 ASTEntryTag :: TagFunctionDecl if expected_ty & OTHER_DECL != 0 => {
20062019 let name = from_value :: < String > ( node. extras [ 0 ] . clone ( ) )
You can’t perform that action at this time.
0 commit comments