Skip to content

Commit fea757e

Browse files
committed
transpile: Compute and store override_tys ahead of time
1 parent 6ec0996 commit fea757e

3 files changed

Lines changed: 487 additions & 0 deletions

File tree

c2rust-transpile/src/c_ast/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,18 @@ impl TypedAstContext {
13831383
_ => false,
13841384
}
13851385
}
1386+
1387+
/// Same as the `Index` trait, but doesn't bypass `Paren`.
1388+
pub fn index_expr_raw(&self, index: CExprId) -> &CExpr {
1389+
static BADEXPR: CExpr = Located {
1390+
loc: None,
1391+
kind: CExprKind::BadExpr,
1392+
};
1393+
match self.c_exprs.get(&index) {
1394+
None => &BADEXPR,
1395+
Some(e) => e,
1396+
}
1397+
}
13861398
}
13871399

13881400
impl CommentContext {

0 commit comments

Comments
 (0)