Create a file name main.rs and the below-given code in it.
fn main() {
println!("Hello, Rust!");
}
For macOS and Linux to run open terminal, put below command
$ rustc main.rs
$ ./main