Skip to content

Instantly share code, notes, and snippets.

@ritiek
Last active January 27, 2018 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritiek/98b140cf7aa44d4a0996e565f2135a44 to your computer and use it in GitHub Desktop.
Save ritiek/98b140cf7aa44d4a0996e565f2135a44 to your computer and use it in GitHub Desktop.
Setup rust-lang local development environment
# git clone https://github.com/rust-lang/rust
# cd rust
# <make changes to source if any>
# full build (1st time)
./x.py install
rustup toolchain link develop build/x86_64-unknown-linux-gnu/stage2
rustup default develop
rustc -V
# <make changes to source if any>
# stage 1 build (every incremental compile, faster build)
# ./x.py build --stage 1
# rustup toolchain link develop build/x86_64-unknown-linux-gnu/stage1
# rustup default develop
# <run tests related to change>
# directory test suite
# ./x.py test src/test/<directory>
# <make sure all tests pass before making PR>
# full test suite
# ./x.py test
# To complile with AST optimizations:
# rustc </path/to/source.rs>
# To compile with NLL optimizations:
# rustc -Znll </path/to/source.rs>
# To compile with MIR optimizations:
# rustc -Zborrowck-mir </path/to/source.rs>
# To compile using cargo:
# cargo rustc -- -Znll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment