To compile rust code, you use rustc
rustc
For example, to compile the file main.rs you would do $ rustc main.rs. This would then create the executable main
main.rs
$ rustc main.rs
main