Rust : インストール2021/09/23 |
|
Rust をインストールします。
|
|
| [1] | Rust をインストールして動作確認します。 |
|
root@dlp:~#
apt -y install rustc
root@dlp:~#
rustc --version rustc 1.48.0 # テストプログラムを作成して動作確認 root@dlp:~# mkdir rust-test root@dlp:~# cd rust-test
root@dlp:~/rust-test# cat > hello-rust.rs <<'EOF'
fn main() {
println!("Hello Rust world !");
}
EOF
root@dlp:~/rust-test#
rustc hello-rust.rs root@dlp:~/rust-test# ./hello-rust Hello Rust world ! # Cargo で Hello World 動作確認 root@dlp:~# cargo --version cargo 1.46.0 cargo new cargo-test --bin
Created binary (application) `cargo-test` package
root@dlp:~# cd cargo-test root@dlp:~/cargo-test# cargo build
Compiling cargo-test v0.1.0 (/root/cargo-test)
Finished dev [unoptimized + debuginfo] target(s) in 0.42s
root@dlp:~/cargo-test# cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/cargo-test`
Hello, world!
|