..
hello world
环境
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.79.0 (129f3b996 2024-06-10)`
cargo 1.79.0 (ffa9cf99a 2024-06-03)
windows 11
打开学习文档
rustup doc --book
根据文档介绍安装
额,好像有什么问题,官网找安装方法吧 https://www.rust-lang.org/tools/install
hello world
创建文件main.rs
fn main() {
println!("Hello world!");
}
编译运行
rustc main.rs
./hello
Hello world!
cargo
cargo new cargo-hello
cd cargo-hello
cargo run