do not buffer #[rustc_regions] dump
This commit is contained in:
@@ -351,12 +351,12 @@ fn do_mir_borrowck<'tcx>(
|
|||||||
|
|
||||||
// We also have a `#[rustc_regions]` annotation that causes us to dump
|
// We also have a `#[rustc_regions]` annotation that causes us to dump
|
||||||
// information.
|
// information.
|
||||||
let diags_buffer = &mut BorrowckDiagnosticsBuffer::default();
|
nll::dump_annotation(&infcx, body, ®ioncx, &opt_closure_req);
|
||||||
nll::dump_annotation(&infcx, body, ®ioncx, &opt_closure_req, diags_buffer);
|
|
||||||
|
|
||||||
let movable_coroutine = body.coroutine.is_some()
|
let movable_coroutine = body.coroutine.is_some()
|
||||||
&& tcx.coroutine_movability(def.to_def_id()) == hir::Movability::Movable;
|
&& tcx.coroutine_movability(def.to_def_id()) == hir::Movability::Movable;
|
||||||
|
|
||||||
|
let diags_buffer = &mut BorrowckDiagnosticsBuffer::default();
|
||||||
// While promoteds should mostly be correct by construction, we need to check them for
|
// While promoteds should mostly be correct by construction, we need to check them for
|
||||||
// invalid moves to detect moving out of arrays:`struct S; fn main() { &([S][0]); }`.
|
// invalid moves to detect moving out of arrays:`struct S; fn main() { &([S][0]); }`.
|
||||||
for promoted_body in &promoted {
|
for promoted_body in &promoted {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ use tracing::{debug, instrument};
|
|||||||
|
|
||||||
use crate::borrow_set::BorrowSet;
|
use crate::borrow_set::BorrowSet;
|
||||||
use crate::consumers::ConsumerOptions;
|
use crate::consumers::ConsumerOptions;
|
||||||
use crate::diagnostics::{BorrowckDiagnosticsBuffer, RegionErrors};
|
use crate::diagnostics::RegionErrors;
|
||||||
use crate::polonius::PoloniusDiagnosticsContext;
|
use crate::polonius::PoloniusDiagnosticsContext;
|
||||||
use crate::polonius::legacy::{
|
use crate::polonius::legacy::{
|
||||||
PoloniusFacts, PoloniusFactsExt, PoloniusLocationTable, PoloniusOutput,
|
PoloniusFacts, PoloniusFactsExt, PoloniusLocationTable, PoloniusOutput,
|
||||||
@@ -297,7 +297,6 @@ pub(super) fn dump_annotation<'tcx, 'infcx>(
|
|||||||
body: &Body<'tcx>,
|
body: &Body<'tcx>,
|
||||||
regioncx: &RegionInferenceContext<'tcx>,
|
regioncx: &RegionInferenceContext<'tcx>,
|
||||||
closure_region_requirements: &Option<ClosureRegionRequirements<'tcx>>,
|
closure_region_requirements: &Option<ClosureRegionRequirements<'tcx>>,
|
||||||
diagnostics_buffer: &mut BorrowckDiagnosticsBuffer<'infcx, 'tcx>,
|
|
||||||
) {
|
) {
|
||||||
let tcx = infcx.tcx;
|
let tcx = infcx.tcx;
|
||||||
let base_def_id = tcx.typeck_root_def_id(body.source.def_id());
|
let base_def_id = tcx.typeck_root_def_id(body.source.def_id());
|
||||||
@@ -335,13 +334,11 @@ pub(super) fn dump_annotation<'tcx, 'infcx>(
|
|||||||
} else {
|
} else {
|
||||||
let mut err = infcx.dcx().struct_span_note(def_span, "no external requirements");
|
let mut err = infcx.dcx().struct_span_note(def_span, "no external requirements");
|
||||||
regioncx.annotate(tcx, &mut err);
|
regioncx.annotate(tcx, &mut err);
|
||||||
|
|
||||||
err
|
err
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME(@lcnr): We currently don't dump the inferred hidden types here.
|
// FIXME(@lcnr): We currently don't dump the inferred hidden types here.
|
||||||
|
err.emit();
|
||||||
diagnostics_buffer.buffer_non_error(err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn for_each_region_constraint<'tcx>(
|
fn for_each_region_constraint<'tcx>(
|
||||||
|
|||||||
Reference in New Issue
Block a user