Navigation Menu

Skip to content

Commit

Permalink
Make generics sharing the default for non-optimized builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Apr 6, 2018
1 parent 4f6d05d commit 8d95c86
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/librustc/ty/context.rs
Expand Up @@ -14,7 +14,7 @@ use dep_graph::DepGraph;
use dep_graph::{DepNode, DepConstructor};
use errors::DiagnosticBuilder;
use session::Session;
use session::config::{BorrowckMode, OutputFilenames};
use session::config::{BorrowckMode, OutputFilenames, OptLevel};
use middle;
use hir::{TraitCandidate, HirId, ItemLocalId};
use hir::def::{Def, Export};
Expand Down Expand Up @@ -1503,8 +1503,18 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
#[inline]
pub fn share_generics(self) -> bool {
match self.sess.opts.debugging_opts.share_generics {
Some(true) => true,
Some(false) | None => false,
Some(setting) => setting,
None => {
self.sess.opts.incremental.is_some() ||
match self.sess.opts.optimize {
OptLevel::No |
OptLevel::Less |
OptLevel::Size |
OptLevel::SizeMin => true,
OptLevel::Default |
OptLevel::Aggressive => false,
}
}
}
}
}
Expand Down

0 comments on commit 8d95c86

Please sign in to comment.