Rust

Rust 언어의 공식 toolchain과 프로젝트 개발 명령을 한곳에서 찾기 위한 안내 페이지.

Rust의 표준 개발 환경은 toolchain 관리자인 rustup, 컴파일러 rustc, 패키지·빌드 도구 cargo를 중심으로 구성된다. 기본 rustup profile에는 formatter인 rustfmt와 lint 도구인 clippy도 포함된다.

공식 권장 설치 방식은 rustup이다. 설치 후 새 shell을 열거나 Unix 계열에서 source "$HOME/.cargo/env"를 실행한다.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
원격 script를 실행하기 전에 URL과 내용을 확인한다. 배포판 package와 rustup toolchain을 함께 쓸 때는 $HOME/.cargo/bin의 PATH 우선순위로 실제 실행 파일이 달라질 수 있다.

rustup 공식 문서가 안내하는 package manager 방식은 Debian 13 이상과 Ubuntu 24.04 이상에서 사용할 수 있다.

sudo apt update
sudo apt install rustup
rustup default stable

rustup 공식 문서는 DNF 계열 package manager가 rustup-init만 제공할 수 있다고 설명하지만 배포판별 package 이름을 고정해 제시하지 않는다. 이 경우 위의 공식 Unix 설치 script를 사용하고, 조직 정책상 RPM package가 필요하면 해당 배포판의 현재 package 정보를 먼저 확인한다.

brew install rustup
rustup default stable

Homebrew 배포에서는 proxy가 PATH에 자동 노출되지 않을 수 있으므로 $(brew –prefix rustup)/bin을 PATH에 추가해야 할 수 있다.

winget install --exact --id Rustlang.Rustup

Windows의 MSVC target은 linker와 Windows SDK가 필요하다. rustup-init이 prerequisite 설치를 제안할 수 있으며, 조직에서는 Visual Studio edition의 license 조건도 확인한다.

rustup --version
rustc --version
cargo --version
cargo new hello-rust
cd hello-rust
cargo run
cargo test
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
  • rustup: stable, beta, nightly toolchain과 component, target 관리.
  • rustc: Rust crate를 직접 컴파일하고 compiler 정보를 조회.
  • cargo: project 생성, dependency, build, test, package, publish 관리.
  • rustfmt / cargo fmt: source format 정규화와 CI format 검사.
  • Clippy / cargo clippy: 일반적인 실수와 비관용적 코드를 lint.
  • rustdoc / cargo doc: API documentation과 documentation test 생성.
  • CARGO_HOME: Cargo cache, registry, installed binary, credential 관련 기본 root. Unix 기본값은 $HOME/.cargo이다.
  • RUSTUP_HOME: rustup toolchain과 metadata root. Unix 기본값은 $HOME/.rustup이다.
  • $CARGO_HOME/bin: rustup proxy와 cargo install 실행 파일이 놓이는 경로.
  • 설치 후 명령을 찾지 못하면 새 shell을 열고 $HOME/.cargo/bin이 PATH에 포함되었는지 확인한다.
  • system package와 rustup을 함께 설치했다면 command -v rustc, rustup which rustc로 실제 compiler를 구분한다.
  • native dependency build가 실패하면 C compiler, linker, system header, pkg-config 같은 platform prerequisite를 확인한다.

+ Rust toolchain help

이 작업 환경에는 Rust toolchain이 설치되어 있지 않아 live help output을 수집하지 않았다.
각 하위 페이지의 공식 문서 링크와 `COMMAND --help`를 사용한다.

+

  • codex:: 2026-07-20 Migrated the legacy Rust install snippet to a language head page and added the standard toolchain command family.
  • /home/u613600155/domains/cli.zerotymer.net/public_html/data/pages/rust/ko.txt
  • 마지막으로 수정됨: 2026/07/20 13:13
  • 저자 127.0.0.1