Add nll_dump_cause helper to Session

This commit is contained in:
Santiago Pastorino 2017-12-19 15:08:40 -03:00 committed by Niko Matsakis
parent 508a831dca
commit 95b6148e31
2 changed files with 5 additions and 2 deletions

View file

@ -437,6 +437,9 @@ impl Session {
pub fn print_llvm_passes(&self) -> bool {
self.opts.debugging_opts.print_llvm_passes
}
pub fn nll_dump_cause(&self) -> bool {
self.opts.debugging_opts.nll_dump_cause
}
pub fn emit_end_regions(&self) -> bool {
self.opts.debugging_opts.emit_end_regions ||
(self.opts.debugging_opts.mir_emit_validate > 0) ||

View file

@ -248,7 +248,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
.map(|origin| RegionDefinition::new(origin))
.collect();
let nll_dump_cause = ty::tls::with(|tcx| tcx.sess.opts.debugging_opts.nll_dump_cause);
let nll_dump_cause = ty::tls::with(|tcx| tcx.sess.nll_dump_cause());
let mut result = Self {
definitions,
@ -1259,7 +1259,7 @@ impl Cause {
pub(crate) fn label_diagnostic(&self, mir: &Mir<'_>, diag: &mut DiagnosticBuilder<'_>) {
// The cause information is pretty messy. Only dump it as an
// internal debugging aid if -Znll-dump-cause is given.
let nll_dump_cause = ty::tls::with(|tcx| tcx.sess.opts.debugging_opts.nll_dump_cause);
let nll_dump_cause = ty::tls::with(|tcx| tcx.sess.nll_dump_cause());
if !nll_dump_cause {
return;
}