Rust

Arch Linux(아치리눅스)에 Rust install

Ninestar 2023. 4. 9. 15:39
반응형
$ mkdir my-rust-project
$ cd my-rust-project

설치

$ sudo pacman -Sy rustup
 
$ rustup default stable
 
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2022-12-15, rust version 1.66.0 (69f9c33d7 2022-12-12)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
 68.0 MiB /  68.0 MiB (100 %)  22.9 MiB/s in  2s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 19.0 MiB /  19.0 MiB (100 %)  15.3 MiB/s in  1s ETA:  0s
info: installing component 'rust-std'
 29.7 MiB /  29.7 MiB (100 %)  17.4 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 68.0 MiB /  68.0 MiB (100 %)  19.7 MiB/s in  3s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu installed - rustc 1.66.0 

 

프로젝트 생성

$ mkdir my-rust-project
$ cd my-rust-project
$ cargo init --bin
 

init 결과

     Created binary (application) package
 
├─src
├───main.rs
├─Cargo.lock
└─Cargo.toml

 

프로젝트 실행

$ cargo run
 Compiling my-first-rust-prj v0.1.0 (/(...)/my-first-rust-prj)
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
     Running `target/debug/my-first-rust-prj`
Hello, world!