about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2020-07-02 22:16:34 +0100
committerWho? Me?! <mark-i-m@users.noreply.github.com>2020-07-04 18:06:41 -0500
commitf571c63e0170e271a9ecc5eace1464c6c6b75c7f (patch)
tree86b515f9f5eeda72f9623344180569799816976c /src/doc/rustc-dev-guide
parentac0e09998d8dce7adea4937d09ca43c3090be1e9 (diff)
downloadrust-f571c63e0170e271a9ecc5eace1464c6c6b75c7f.tar.gz
rust-f571c63e0170e271a9ecc5eace1464c6c6b75c7f.zip
Suggest selectively disabling optimizations
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/building/suggested.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/building/suggested.md b/src/doc/rustc-dev-guide/src/building/suggested.md
index 4491a3b7233..102586721d0 100644
--- a/src/doc/rustc-dev-guide/src/building/suggested.md
+++ b/src/doc/rustc-dev-guide/src/building/suggested.md
@@ -87,6 +87,22 @@ You can also use `--keep-stage 1` when running tests. Something like this:
 - Initial test run: `./x.py test -i --stage 1 src/test/ui`
 - Subsequent test run: `./x.py test -i --stage 1 src/test/ui --keep-stage 1`
 
+## Fine-tuning optimizations
+
+Setting `optimize = false` makes the compiler too slow for tests. However, to
+improve the test cycle, you can disable optimizations selectively only for the
+crates you'll have to rebuild
+([source](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/incremental.20compilation.20question/near/202712165)).
+For example, when working on `rustc_mir_build`, the `rustc_mir_build` and
+`rustc_driver` crates take the most time to incrementally rebuild. You could
+therefore set the following in the root `Cargo.toml`:
+```toml
+[profile.release.package.rustc_mir_build]
+opt-level = 0
+[profile.release.package.rustc_driver]
+opt-level = 0
+```
+
 ## Working on multiple branches at the same time
 
 Working on multiple branches in parallel can be a little annoying, since