Skip to content

Commit 0186459

Browse files
committed
do not buffer #[rustc_regions] dump
1 parent 848187c commit 0186459

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Diff for: compiler/rustc_borrowck/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,12 @@ fn do_mir_borrowck<'tcx>(
351351

352352
// We also have a `#[rustc_regions]` annotation that causes us to dump
353353
// information.
354-
let diags_buffer = &mut BorrowckDiagnosticsBuffer::default();
355-
nll::dump_annotation(&infcx, body, &regioncx, &opt_closure_req, diags_buffer);
354+
nll::dump_annotation(&infcx, body, &regioncx, &opt_closure_req);
356355

357356
let movable_coroutine = body.coroutine.is_some()
358357
&& tcx.coroutine_movability(def.to_def_id()) == hir::Movability::Movable;
359358

359+
let diags_buffer = &mut BorrowckDiagnosticsBuffer::default();
360360
// While promoteds should mostly be correct by construction, we need to check them for
361361
// invalid moves to detect moving out of arrays:`struct S; fn main() { &([S][0]); }`.
362362
for promoted_body in &promoted {

Diff for: compiler/rustc_borrowck/src/nll.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use tracing::{debug, instrument};
2121

2222
use crate::borrow_set::BorrowSet;
2323
use crate::consumers::ConsumerOptions;
24-
use crate::diagnostics::{BorrowckDiagnosticsBuffer, RegionErrors};
24+
use crate::diagnostics::RegionErrors;
2525
use crate::polonius::PoloniusDiagnosticsContext;
2626
use crate::polonius::legacy::{
2727
PoloniusFacts, PoloniusFactsExt, PoloniusLocationTable, PoloniusOutput,
@@ -297,7 +297,6 @@ pub(super) fn dump_annotation<'tcx, 'infcx>(
297297
body: &Body<'tcx>,
298298
regioncx: &RegionInferenceContext<'tcx>,
299299
closure_region_requirements: &Option<ClosureRegionRequirements<'tcx>>,
300-
diagnostics_buffer: &mut BorrowckDiagnosticsBuffer<'infcx, 'tcx>,
301300
) {
302301
let tcx = infcx.tcx;
303302
let base_def_id = tcx.typeck_root_def_id(body.source.def_id());
@@ -335,13 +334,11 @@ pub(super) fn dump_annotation<'tcx, 'infcx>(
335334
} else {
336335
let mut err = infcx.dcx().struct_span_note(def_span, "no external requirements");
337336
regioncx.annotate(tcx, &mut err);
338-
339337
err
340338
};
341339

342340
// FIXME(@lcnr): We currently don't dump the inferred hidden types here.
343-
344-
diagnostics_buffer.buffer_non_error(err);
341+
err.emit();
345342
}
346343

347344
fn for_each_region_constraint<'tcx>(

0 commit comments

Comments
 (0)