C2SaferRust: Transforming C Projects into Safer Rust with NeuroSymbolic Techniques
Not on the map. Why?
Abstract (arXiv)
In recent years, there has been a lot of interest in converting C code to Rust, to benefit from the memory and thread safety guarantees of Rust. C2Rust is a rule-based system that can automatically convert C code to functionally identical Rust, but the Rust code that it produces is non-idiomatic, i.e., makes extensive use of unsafe Rust, a subset of the language that doesn't have memory or thread safety guarantees. At the other end of the spectrum are LLMs, which produce idiomatic Rust code, but these have the potential to make mistakes and are constrained in the length of code they can process. In this paper, we present C2SaferRust, a novel approach to translate C to Rust that combines the strengths of C2Rust and LLMs. We first use C2Rust to convert C code to non-idiomatic, unsafe Rust. We then decompose the unsafe Rust code into slices that can be individually translated to safer Rust by an LLM. After processing each slice, we run end-to-end test cases to verify that the code still functions as expected. We also contribute a benchmark of 7 real-world programs, translated from C to unsafe Rust using C2Rust. Each of these programs also comes with end-to-end test cases. On this benchmark, we are able to reduce the number of raw pointers by up to 38%, and reduce the amount of unsafe code by up to 28%, indicating an increase in safety. The resulting programs still pass all test cases. C2SaferRust also shows convincing gains in performance against two previous techniques for making Rust code safer.
Key facts. Cited by 18 papers in the map (data through 14 Oct 2026). First posted on arXiv 24 Jan 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 8; 2026: 10.
18 papers.
Sort:
By area:
- 2025CRUST-Bench: A Comprehensive Benchmark for C-to-safe-Rust Transpilationcited by 19
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translationcited by 19
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025SACTOR: LLM-Driven Correct and Idiomatic C to Rust Translation with Static Analysis and FFI-Based Verificationcited by 9
- 2025MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repaircited by 4
- 2025Adversarial Agent Collaboration for Correctness Improvements of C to Safe Rust Translationcited by 3
- 2025Project-Level C-to-Rust Translation via Pointer Knowledge Graphscited by 3
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translationcited by 2
- 2026ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositoriescited by 2
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migrationcited by 1
- 2026ORBIT: Guided Agentic Orchestration for Autonomous C-to-Rust Transpilationcited by 1
- 2026CodePivot: Bootstrapping Multilingual Transpilation in LLMs via Reinforcement Learning without Parallel Corporacited by 1
6 more
- 2025Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generationcited by 0
- 2026Documentation-Guided Agentic Codebase Migration from C to Rustcited by 0
- 2026CNnotator: LLM-Guided Memory Safety Annotation Synthesiscited by 0
- 2026Towards Reliable C-to-Rust Translation with Rule-Guided Reasoning and Reinforcement Learningcited by 0
- 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFTcited by 0
- 2026Translator vs. Challenger: Adversarial Agentic Learning for C-to-Rust Translationcited by 0
- 2026Translator vs. Challenger: Adversarial Agentic Learning for C-to-Rust Translation14 Sep 2026
- 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT13 Aug 2026
- 2026Towards Reliable C-to-Rust Translation with Rule-Guided Reasoning and Reinforcement Learning22 Jul 2026
- 2026CNnotator: LLM-Guided Memory Safety Annotation Synthesis20 Jun 2026
- 2026Documentation-Guided Agentic Codebase Migration from C to Rust14 May 2026
- 2026CodePivot: Bootstrapping Multilingual Transpilation in LLMs via Reinforcement Learning without Parallel Corpora20 Apr 2026
- 2026ORBIT: Guided Agentic Orchestration for Autonomous C-to-Rust Transpilation13 Apr 2026
- 2026ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositories8 Apr 2026
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translation6 Apr 2026
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migration3 Mar 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Project-Level C-to-Rust Translation via Pointer Knowledge Graphs13 Oct 2025
6 more
- 2025Adversarial Agent Collaboration for Correctness Improvements of C to Safe Rust Translation4 Oct 2025
- 2025MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair19 Sep 2025
- 2025Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generation28 Aug 2025
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translation6 Aug 2025
- 2025CRUST-Bench: A Comprehensive Benchmark for C-to-safe-Rust Transpilation21 Apr 2025
- 2025SACTOR: LLM-Driven Correct and Idiomatic C to Rust Translation with Static Analysis and FFI-Based Verification16 Mar 2025
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025Adversarial Agent Collaboration for Correctness Improvements of C to Safe Rust Translationcited by 3
- 2026ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositoriescited by 2
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migrationcited by 1
- 2026ORBIT: Guided Agentic Orchestration for Autonomous C-to-Rust Transpilationcited by 1
- 2026Documentation-Guided Agentic Codebase Migration from C to Rustcited by 0
- 2026Translator vs. Challenger: Adversarial Agentic Learning for C-to-Rust Translationcited by 0
- 2026Translator vs. Challenger: Adversarial Agentic Learning for C-to-Rust Translation14 Sep 2026
- 2026Documentation-Guided Agentic Codebase Migration from C to Rust14 May 2026
- 2026ORBIT: Guided Agentic Orchestration for Autonomous C-to-Rust Transpilation13 Apr 2026
- 2026ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositories8 Apr 2026
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migration3 Mar 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Adversarial Agent Collaboration for Correctness Improvements of C to Safe Rust Translation4 Oct 2025
- 2025CRUST-Bench: A Comprehensive Benchmark for C-to-safe-Rust Transpilationcited by 19
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translationcited by 19
- 2025SACTOR: LLM-Driven Correct and Idiomatic C to Rust Translation with Static Analysis and FFI-Based Verificationcited by 9
- 2025MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repaircited by 4
- 2025Project-Level C-to-Rust Translation via Pointer Knowledge Graphscited by 3
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translationcited by 2
- 2025Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generationcited by 0
- 2026CNnotator: LLM-Guided Memory Safety Annotation Synthesiscited by 0
- 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFTcited by 0
- 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT13 Aug 2026
- 2026CNnotator: LLM-Guided Memory Safety Annotation Synthesis20 Jun 2026
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translation6 Apr 2026
- 2025Project-Level C-to-Rust Translation via Pointer Knowledge Graphs13 Oct 2025
- 2025MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair19 Sep 2025
- 2025Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generation28 Aug 2025
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translation6 Aug 2025
- 2025CRUST-Bench: A Comprehensive Benchmark for C-to-safe-Rust Transpilation21 Apr 2025
- 2025SACTOR: LLM-Driven Correct and Idiomatic C to Rust Translation with Static Analysis and FFI-Based Verification16 Mar 2025