We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Paren
CExprId
1 parent 55063c8 commit e5dbb16Copy full SHA for e5dbb16
1 file changed
c2rust-transpile/src/c_ast/mod.rs
@@ -1519,21 +1519,15 @@ impl Index<CTypeId> for TypedAstContext {
1519
1520
impl Index<CExprId> for TypedAstContext {
1521
type Output = CExpr;
1522
+
1523
fn index(&self, index: CExprId) -> &CExpr {
1524
static BADEXPR: CExpr = Located {
1525
loc: None,
1526
kind: CExprKind::BadExpr,
1527
};
1528
match self.c_exprs.get(&index) {
1529
None => &BADEXPR, // panic!("Could not find {:?} in TypedAstContext", index),
- Some(e) => {
1530
- // Transparently index through Paren expressions
1531
- if let CExprKind::Paren(_, subexpr) = e.kind {
1532
- self.index(subexpr)
1533
- } else {
1534
- e
1535
- }
1536
+ Some(e) => e,
1537
}
1538
1539
0 commit comments