Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Sep 12, 2019
1 parent 68b1a87 commit 23db450
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Expand Up @@ -56,6 +56,7 @@ enum Trace {

/// Various pieces of state used when reporting borrow checker errors.
pub struct ErrorReportingCtx<'a, 'b, 'tcx> {
#[allow(dead_code)] // FIXME(mark-i-m): used by outlives suggestions
rinfcx: &'b RegionInferenceContext<'tcx>,
infcx: &'b InferCtxt<'a, 'tcx>,

Expand Down Expand Up @@ -335,12 +336,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
}
(ConstraintCategory::Assignment, true, false)
| (ConstraintCategory::CallArgument, true, false) => {
let mut db = self.report_escaping_data_error(&errctx, &errci, renctx);
let db = self.report_escaping_data_error(&errctx, &errci, renctx);

db
}
_ => {
let mut db = self.report_general_error(&errctx, &errci, renctx);
let db = self.report_general_error(&errctx, &errci, renctx);

db
}
Expand Down
6 changes: 5 additions & 1 deletion src/librustc_mir/borrow_check/nll/region_infer/mod.rs
Expand Up @@ -11,7 +11,6 @@ use crate::borrow_check::nll::{
region_infer::values::{
PlaceholderIndices, RegionElement, ToElementIndex
},
region_infer::error_reporting::outlives_suggestion::OutlivesSuggestionBuilder,
type_check::{free_region_relations::UniversalRegionRelations, Locations},
};
use crate::borrow_check::Upvar;
Expand Down Expand Up @@ -1340,6 +1339,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
mir_def_id,
fr,
&mut propagated_outlives_requirements,
errors_buffer,
region_naming,
);
}
Expand Down Expand Up @@ -1371,6 +1371,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
mir_def_id: DefId,
longer_fr: RegionVid,
propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
errors_buffer: &mut Vec<Diagnostic>,
region_naming: &mut RegionErrorNamingCtx,
) {
debug!("check_universal_region(fr={:?})", longer_fr);
Expand Down Expand Up @@ -1398,6 +1399,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
upvars,
mir_def_id,
propagated_outlives_requirements,
errors_buffer,
region_naming,
);
return;
Expand All @@ -1414,6 +1416,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
upvars,
mir_def_id,
propagated_outlives_requirements,
errors_buffer,
region_naming,
) {
// continuing to iterate just reports more errors than necessary
Expand All @@ -1435,6 +1438,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
upvars: &[Upvar],
mir_def_id: DefId,
propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
errors_buffer: &mut Vec<Diagnostic>,
region_naming: &mut RegionErrorNamingCtx,
) -> Option<ErrorReported> {
// If it is known that `fr: o`, carry on.
Expand Down

0 comments on commit 23db450

Please sign in to comment.