rustc is the compiler for the Rust programming language. It translates Rust source code into executable programs and libraries, enforcing the language’s rules before generating machine code. Although developers generally invoke rustc through Cargo, the compiler can also be used directly for individual programs and more specialized compilation tasks.
An important part of rustc’s work happens before machine-code generation. The compiler checks ownership, borrowing, lifetimes, types, and trait implementations, rejecting programs that violate Rust’s safety rules. These checks allow many memory-management errors to be detected during compilation rather than at runtime. After analysis, the program passes through intermediate representations used for optimization and code generation. rustc also employs a query-based architecture that helps it reuse previously computed information when source files change, reducing redundant work during development.
This is free and open source software.
Key Features
- Compilation of Rust source code into native executables and libraries.
- Ownership and borrowing checks that enforce Rust’s memory safety rules.
- Static type checking, type inference, and trait resolution.
- Lifetime analysis and validation of references.
- Macro expansion for declarative and procedural macros.
- Monomorphization of generic functions and types.
- Incremental compilation that reuses results from previous compilation sessions.
- LLVM-based machine-code generation and optimization.
- Configurable optimization, code-generation, and debugging options.
- Detailed error diagnostics with source locations and suggested corrections.
- Support for conditional compilation using configuration attributes.
- Generation of LLVM intermediate representation and assembly output.
- Cross-compilation for supported operating systems and processor architectures.
- Support for compiler plugins through the established procedural macro interface.
- Cross-platform support – runs on Linux, macOS, and Windows.
Website: github.com/rust-lang/rust
Support:
Developer: Rust Project contributors
License: Apache License 2.0 and MIT License
rustc itself is written in Rust. Learn Rust with our recommended free books and free tutorials.
Related Software
| Compilers | |
|---|---|
| GNU Compiler Collection | The standard compiler for most Unix-like operating systems |
| rustc | Compiler for the Rust programming language |
| AOCC | AMD Optimizing C/C++ Compiler |
| LLVM | Low-Level Virtual Machine (LLVM) compiler for C/C++ |
| ispc | Intel SPMD Program Compiler |
| Babel | JavaScript compiler - use next generation JavaScript |
| Glasgow Haskell Compiler | An optimizing compiler for Haskell, written in Haskell |
| Clang | C Language Family Frontend for LLVM |
| Nuitka | Optimizing Python compiler |
| CHICKEN | Compiler for the Scheme programming language |
| FreeBASIC | 32-bit BASIC compiler |
| Numba | Compiler for Python array and numerical functions |
| Free Pascal | Advanced Pascal compiler for Pascal and Object Pascal |
| NASM | Assembler for the x86 CPU architecture |
| Bigloo | Practical Scheme compiler |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.