]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #54557 - michaelwoerister:dont-auto-share-generics-for-incr-comp...
authorPietro Albini <pietro@pietroalbini.org>
Tue, 25 Sep 2018 20:34:50 +0000 (22:34 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Sep 2018 20:34:50 +0000 (22:34 +0200)
incr.comp.: Don't automatically enable -Zshare-generics for incr. comp. builds.

So far the compiler would automatically enable sharing of monomorphizations for incremental builds. That was OK because without (Thin)LTO this could have very little impact on the runtime performance of the generated code. However, since https://github.com/rust-lang/rust/pull/53673, ThinLTO and incr. comp. can be combined, so the trade-off is not as clear anymore.

This PR removes the automatic tie between the two options. Whether monomorphizations are shared between crates or not now _only_ depends on the optimization level.

r? @alexcrichton

src/librustc/session/config.rs

index 1fdbf687be8f81f3c99820b1240cf0c00cb6eff0..8fa15d48a5dc9692f3fdfa38b71f9f34d8ae4814 100644 (file)
@@ -646,7 +646,6 @@ pub fn share_generics(&self) -> bool {
         match self.debugging_opts.share_generics {
             Some(setting) => setting,
             None => {
-                self.incremental.is_some() ||
                 match self.optimize {
                     OptLevel::No   |
                     OptLevel::Less |