From 6669e05e431ef7b62baef035cd28b554fb325b8b Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Wed, 20 Aug 2025 17:08:50 -0700 Subject: [PATCH 1/2] transpile: fix doc comment for `fn TypedAstContext::expr_diverges` --- c2rust-transpile/src/c_ast/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c2rust-transpile/src/c_ast/mod.rs b/c2rust-transpile/src/c_ast/mod.rs index 4ead19296..a293f438d 100644 --- a/c2rust-transpile/src/c_ast/mod.rs +++ b/c2rust-transpile/src/c_ast/mod.rs @@ -601,8 +601,8 @@ impl TypedAstContext { } } - // Pessimistically try to check if an expression doesn't return. If it does, or we can't tell - /// that it doesn't, return `false`. + /// Pessimistically try to check if an expression doesn't return. + /// If it does, or we can't tell that it doesn't, return `false`. pub fn expr_diverges(&self, expr_id: CExprId) -> bool { let func_id = match self.index(expr_id).kind { CExprKind::Call(_, func_id, _) => func_id, From 868d13330d9d1c368c48a44a23aa87998cb4cb5b Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Wed, 20 Aug 2025 17:10:21 -0700 Subject: [PATCH 2/2] transpile: clarify in `enum CExprKind` docs that it's modeled on Clang's APIs, so look there for missing docs --- c2rust-transpile/src/c_ast/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/c2rust-transpile/src/c_ast/mod.rs b/c2rust-transpile/src/c_ast/mod.rs index a293f438d..1b759cfc3 100644 --- a/c2rust-transpile/src/c_ast/mod.rs +++ b/c2rust-transpile/src/c_ast/mod.rs @@ -1186,6 +1186,9 @@ pub enum OffsetOfKind { /// Represents an expression in C (6.5 Expressions) /// +/// This is modeled on Clang's APIs, so where documentation +/// is lacking here, look at Clang. +/// /// We've kept a qualified type on every node since Clang has this information available, and since /// the semantics of translations of certain constructs often depend on the type of the things they /// are given.