About C2Rust

The C2Rust project is being developed by Galois and Immunant. This tool is able to translate most C modules into semantically equivalent Rust code. These modules are intended to be compiled in isolation in order to produce compatible object files. We are developing several tools that help transform the initial Rust sources into idiomatic Rust.

The translator focuses on supporting the C99 standard. C source code is parsed and typechecked using clang before being translated by our tool.

This project is available under the BSD-3 license.

Downloads

Source code and instructions are available in our git repository.

Documentation

The C2Rust manual is available online and is our comprehensive documentation for using and developing C2Rust.

Learn More

More information about installing c2rust from crates.io is availble in this introductory blog post:

Introduction to C2Rust

Per Larsen recently presented a talk on C2Rust at RustConf detailing both our approach to translation as well as our cross-checking approach to testing the resulting translations.

RustConf 2018 - C2Rust: Migrating Legacy Code to Rust

Eric Mertens wrote a blog post describing some of the challenges we encountered during translation of C to Rust and how C2Rust tackles them.

C2Rust Challenges

Environment