Remove unused body args
This commit is contained in:
parent
17cbdfd071
commit
2be6301857
@ -310,13 +310,11 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||
borrow_region: RegionVid,
|
||||
outlived_region: RegionVid,
|
||||
) -> (ConstraintCategory<'tcx>, bool, Span, Option<RegionName>) {
|
||||
let BlameConstraint { category, from_closure, cause, variance_info: _ } =
|
||||
self.regioncx.best_blame_constraint(
|
||||
&self.body,
|
||||
borrow_region,
|
||||
NllRegionVariableOrigin::FreeRegion,
|
||||
|r| self.regioncx.provides_universal_region(r, borrow_region, outlived_region),
|
||||
);
|
||||
let BlameConstraint { category, from_closure, cause, variance_info: _ } = self
|
||||
.regioncx
|
||||
.best_blame_constraint(borrow_region, NllRegionVariableOrigin::FreeRegion, |r| {
|
||||
self.regioncx.provides_universal_region(r, borrow_region, outlived_region)
|
||||
});
|
||||
|
||||
let outlived_fr_name = self.give_region_a_name(outlived_region);
|
||||
|
||||
|
@ -234,7 +234,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||
|
||||
// Find the code to blame for the fact that `longer_fr` outlives `error_fr`.
|
||||
let (_, cause) = self.regioncx.find_outlives_blame_span(
|
||||
&self.body,
|
||||
longer_fr,
|
||||
NllRegionVariableOrigin::Placeholder(placeholder),
|
||||
error_vid,
|
||||
@ -356,7 +355,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||
debug!("report_region_error(fr={:?}, outlived_fr={:?})", fr, outlived_fr);
|
||||
|
||||
let BlameConstraint { category, cause, variance_info, from_closure: _ } =
|
||||
self.regioncx.best_blame_constraint(&self.body, fr, fr_origin, |r| {
|
||||
self.regioncx.best_blame_constraint(fr, fr_origin, |r| {
|
||||
self.regioncx.provides_universal_region(r, fr, outlived_fr)
|
||||
});
|
||||
|
||||
|
@ -590,13 +590,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
// constraints were too strong, and if so, emit or propagate those errors.
|
||||
if infcx.tcx.sess.opts.unstable_opts.polonius {
|
||||
self.check_polonius_subset_errors(
|
||||
body,
|
||||
outlives_requirements.as_mut(),
|
||||
&mut errors_buffer,
|
||||
polonius_output.expect("Polonius output is unavailable despite `-Z polonius`"),
|
||||
);
|
||||
} else {
|
||||
self.check_universal_regions(body, outlives_requirements.as_mut(), &mut errors_buffer);
|
||||
self.check_universal_regions(outlives_requirements.as_mut(), &mut errors_buffer);
|
||||
}
|
||||
|
||||
if errors_buffer.is_empty() {
|
||||
@ -1409,7 +1408,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
/// report them as errors.
|
||||
fn check_universal_regions(
|
||||
&self,
|
||||
body: &Body<'tcx>,
|
||||
mut propagated_outlives_requirements: Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
|
||||
errors_buffer: &mut RegionErrors<'tcx>,
|
||||
) {
|
||||
@ -1420,7 +1418,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
// they did not grow too large, accumulating any requirements
|
||||
// for our caller into the `outlives_requirements` vector.
|
||||
self.check_universal_region(
|
||||
body,
|
||||
fr,
|
||||
&mut propagated_outlives_requirements,
|
||||
errors_buffer,
|
||||
@ -1461,7 +1458,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
/// report them as errors.
|
||||
fn check_polonius_subset_errors(
|
||||
&self,
|
||||
body: &Body<'tcx>,
|
||||
mut propagated_outlives_requirements: Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
|
||||
errors_buffer: &mut RegionErrors<'tcx>,
|
||||
polonius_output: Rc<PoloniusOutput>,
|
||||
@ -1508,7 +1504,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
let propagated = self.try_propagate_universal_region_error(
|
||||
*longer_fr,
|
||||
*shorter_fr,
|
||||
body,
|
||||
&mut propagated_outlives_requirements,
|
||||
);
|
||||
if propagated == RegionRelationCheckResult::Error {
|
||||
@ -1548,13 +1543,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
///
|
||||
/// Things that are to be propagated are accumulated into the
|
||||
/// `outlives_requirements` vector.
|
||||
#[instrument(
|
||||
skip(self, body, propagated_outlives_requirements, errors_buffer),
|
||||
level = "debug"
|
||||
)]
|
||||
#[instrument(skip(self, propagated_outlives_requirements, errors_buffer), level = "debug")]
|
||||
fn check_universal_region(
|
||||
&self,
|
||||
body: &Body<'tcx>,
|
||||
longer_fr: RegionVid,
|
||||
propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
|
||||
errors_buffer: &mut RegionErrors<'tcx>,
|
||||
@ -1577,7 +1568,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
if let RegionRelationCheckResult::Error = self.check_universal_region_relation(
|
||||
longer_fr,
|
||||
representative,
|
||||
body,
|
||||
propagated_outlives_requirements,
|
||||
) {
|
||||
errors_buffer.push(RegionErrorKind::RegionError {
|
||||
@ -1597,7 +1587,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
if let RegionRelationCheckResult::Error = self.check_universal_region_relation(
|
||||
longer_fr,
|
||||
shorter_fr,
|
||||
body,
|
||||
propagated_outlives_requirements,
|
||||
) {
|
||||
// We only report the first region error. Subsequent errors are hidden so as
|
||||
@ -1622,7 +1611,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
&self,
|
||||
longer_fr: RegionVid,
|
||||
shorter_fr: RegionVid,
|
||||
body: &Body<'tcx>,
|
||||
propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
|
||||
) -> RegionRelationCheckResult {
|
||||
// If it is known that `fr: o`, carry on.
|
||||
@ -1638,7 +1626,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
self.try_propagate_universal_region_error(
|
||||
longer_fr,
|
||||
shorter_fr,
|
||||
body,
|
||||
propagated_outlives_requirements,
|
||||
)
|
||||
}
|
||||
@ -1650,7 +1637,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
&self,
|
||||
longer_fr: RegionVid,
|
||||
shorter_fr: RegionVid,
|
||||
body: &Body<'tcx>,
|
||||
propagated_outlives_requirements: &mut Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,
|
||||
) -> RegionRelationCheckResult {
|
||||
if let Some(propagated_outlives_requirements) = propagated_outlives_requirements {
|
||||
@ -1662,7 +1648,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
debug!("try_propagate_universal_region_error: fr_minus={:?}", fr_minus);
|
||||
|
||||
let blame_span_category = self.find_outlives_blame_span(
|
||||
body,
|
||||
longer_fr,
|
||||
NllRegionVariableOrigin::FreeRegion,
|
||||
shorter_fr,
|
||||
@ -1816,7 +1801,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
|
||||
pub(crate) fn retrieve_closure_constraint_info(
|
||||
&self,
|
||||
_body: &Body<'tcx>,
|
||||
constraint: &OutlivesConstraint<'tcx>,
|
||||
) -> BlameConstraint<'tcx> {
|
||||
let loc = match constraint.locations {
|
||||
@ -1851,13 +1835,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
/// Finds a good `ObligationCause` to blame for the fact that `fr1` outlives `fr2`.
|
||||
pub(crate) fn find_outlives_blame_span(
|
||||
&self,
|
||||
body: &Body<'tcx>,
|
||||
fr1: RegionVid,
|
||||
fr1_origin: NllRegionVariableOrigin,
|
||||
fr2: RegionVid,
|
||||
) -> (ConstraintCategory<'tcx>, ObligationCause<'tcx>) {
|
||||
let BlameConstraint { category, cause, .. } =
|
||||
self.best_blame_constraint(body, fr1, fr1_origin, |r| {
|
||||
self.best_blame_constraint(fr1, fr1_origin, |r| {
|
||||
self.provides_universal_region(r, fr1, fr2)
|
||||
});
|
||||
(category, cause)
|
||||
@ -2045,7 +2028,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
#[instrument(level = "debug", skip(self, target_test))]
|
||||
pub(crate) fn best_blame_constraint(
|
||||
&self,
|
||||
body: &Body<'tcx>,
|
||||
from_region: RegionVid,
|
||||
from_region_origin: NllRegionVariableOrigin,
|
||||
target_test: impl Fn(RegionVid) -> bool,
|
||||
@ -2091,7 +2073,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
.iter()
|
||||
.map(|constraint| {
|
||||
if constraint.category == ConstraintCategory::ClosureBounds {
|
||||
self.retrieve_closure_constraint_info(body, &constraint)
|
||||
self.retrieve_closure_constraint_info(&constraint)
|
||||
} else {
|
||||
BlameConstraint {
|
||||
category: constraint.category,
|
||||
|
Loading…
x
Reference in New Issue
Block a user