Make generics sharing the default for non-optimized builds.
This commit is contained in:
parent
4f6d05dc48
commit
8d95c86974
1 changed files with 13 additions and 3 deletions
|
|
@ -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};
|
||||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue