Skip to content
Conference

RustGuard: Post-Transpilation Semantic Analysis and Safety Metrics for LLM-Assisted C-to-Rust Translation

Sep 2026 · 2026 International Conference on Sustainability, Innovation & Technology (ICSIT) · pp. 1-6 · 0 citations · 37 references

Abstract

One of the reasons why Rust is so popular is that it guarantees safety at compile time. A new and dangerous trend, though, has emerged with the advent of automatic code generators like code that can be translated from C to Rust and Large Language Models (LLMs): False Sense of Security - compiled. rs files that seem safe simply because of unknown bugs like pointer aliasing, strange ownership rules, or silent bugs that pass the regular compiler tests. In this paper, we present a heuristic semantic analysis framework for post-transpilation code, RustGuard, that leverages, among others, program data flow analysis, ownership graph traversal and pattern-matching over the AST using heuristic methods, to address the limitations of static analysis. A multi-dimensional set of quality measures is suggested for strict evaluation of safety of transpilation: Semantic Safety Score (SSS), Unsafe Exposure Index (UEI), Vulnerability Retention Rate (VRR) and the Heuristic Recall Rate (HRR). Running as a pre-commit hook, RustGuard was lightweight, and captured embedded double-free hallucinations and unsafe boundaries which made it possible to verify automated code generation on 127 LLM-generated Rust files for the first time with end-to-end analysis latency of \~{}280ms.

View source

Similar papers

Book Open access Oct 2026

SafeDep: Detecting State Mutation Unsoundness in Rust via Dependency Slicing and LLM Reasoning

Rust's type system protects safe code, but many low-level abstractions depend on internal unsafe operations whose correctness rests on memory and logical invariants. In struct-based abstractions, a sibling method may legally modify internal fields while invalidating a precondition required by another method's unsafe op...

Zi-Hao Rao, Yi-Lin Chen, Cheng-Jun Chen et al. · 0 citations
Open access Oct 2026

RICE: Harnessing LLMs and Historical Issues to Discover Internal Rust Compiler Errors

Rust is a modern system-level programming language that emphasizes safety, concurrency, and performance. Ensuring the reliability of the Rust compiler is critical, as undetected compiler defects, particularly internal compiler errors (ICEs), can lead to runtime crashes or undefined behavior in system software. Existing...

Lang-Yi Lu, Wei You, Bin Liang et al. · 0 citations
Preprint Nov 2026

Verified Implementation of the Next-gen Borrow Checking Algorithm for Rust via Abstract Interpretation

Borrow checking is a central mechanism for Rust to ensure temporal memory safety. Its correctness is based on the intuition that the Aliasing XOR Mutability discipline guarantees that programs without borrow errors inherently could not access invalid references (i.e., pointers). However, existing work on formalizing bo...

Jin-Hua Wu, Yu-Ting Wang, Zhe-Min Chen · 0 citations
#artificial intelligence Review Nov 2026

Crustify: Repository-Level Generation of Safe Rust Bindings with LLM Agents and Coverage-Guided Testing

Wrapping C code in a safe Rust interface lets Rust applications use it without writing unsafe code, until the code itself is migrated to Rust. Such bindings are tedious and error-prone to write, however: their internals use unsafe code that the Rust compiler does not check, so a single mistake can introduce undefined b...

Marius Momeu, Marius Arvinte, Cory Cornelius et al. · 0 citations
#software testing Book Open access Oct 2026

Towards Scalable and Verifiable Automated Translation from C to Safe Rust

Memory-safety bugs are one of the oldest and most common sources of security vulnerabilities, and their modern-day prevalence is a consequence of the widespread use of non-memory-safe languages such as C and C++. Transitioning away from C and C++ to memory-safe languages, namely Rust, to eliminate memory-safety bugs is...

Victor Chen · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.