Skip to content

Commit 95b6148

Browse files
spastorinonikomatsakis
authored andcommitted
Add nll_dump_cause helper to Session
1 parent 508a831 commit 95b6148

File tree

2 files changed

+5
-2
lines changed
  • src
    • librustc/session
    • librustc_mir/borrow_check/nll/region_infer

2 files changed

+5
-2
lines changed

src/librustc/session/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ impl Session {
437437
pub fn print_llvm_passes(&self) -> bool {
438438
self.opts.debugging_opts.print_llvm_passes
439439
}
440+
pub fn nll_dump_cause(&self) -> bool {
441+
self.opts.debugging_opts.nll_dump_cause
442+
}
440443
pub fn emit_end_regions(&self) -> bool {
441444
self.opts.debugging_opts.emit_end_regions ||
442445
(self.opts.debugging_opts.mir_emit_validate > 0) ||

src/librustc_mir/borrow_check/nll/region_infer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
248248
.map(|origin| RegionDefinition::new(origin))
249249
.collect();
250250

251-
let nll_dump_cause = ty::tls::with(|tcx| tcx.sess.opts.debugging_opts.nll_dump_cause);
251+
let nll_dump_cause = ty::tls::with(|tcx| tcx.sess.nll_dump_cause());
252252

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

0 commit comments

Comments
 (0)