Remove dead args from functions · rust-lang/rust@6b2a824 (original) (raw)

`@@ -658,7 +658,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {

`

658

658

`pub(super) fn solve(

`

659

659

`&mut self,

`

660

660

`infcx: &InferCtxt<'tcx>,

`

661

``

`-

param_env: ty::ParamEnv<'tcx>,

`

662

661

`body: &Body<'tcx>,

`

663

662

`polonius_output: Option<Rc>,

`

664

663

`) -> (Option<ClosureRegionRequirements<'tcx>>, RegionErrors<'tcx>) {

`

`@@ -674,7 +673,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {

`

674

673

`// eagerly.

`

675

674

`let mut outlives_requirements = infcx.tcx.is_typeck_child(mir_def_id).then(Vec::new);

`

676

675

``

677

``

`-

self.check_type_tests(infcx, body, outlives_requirements.as_mut(), &mut errors_buffer);

`

``

676

`+

self.check_type_tests(infcx, outlives_requirements.as_mut(), &mut errors_buffer);

`

678

677

``

679

678

`debug!(?errors_buffer);

`

680

679

`debug!(?outlives_requirements);

`

`@@ -932,7 +931,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {

`

932

931

`fn check_type_tests(

`

933

932

`&self,

`

934

933

`infcx: &InferCtxt<'tcx>,

`

935

``

`-

body: &Body<'tcx>,

`

936

934

`mut propagated_outlives_requirements: Option<&mut Vec<ClosureOutlivesRequirement<'tcx>>>,

`

937

935

`errors_buffer: &mut RegionErrors<'tcx>,

`

938

936

`) {

`

`@@ -957,12 +955,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {

`

957

955

`}

`

958

956

``

959

957

`if let Some(propagated_outlives_requirements) = &mut propagated_outlives_requirements {

`

960

``

`-

if self.try_promote_type_test(

`

961

``

`-

infcx,

`

962

``

`-

body,

`

963

``

`-

type_test,

`

964

``

`-

propagated_outlives_requirements,

`

965

``

`-

) {

`

``

958

`+

if self.try_promote_type_test(infcx, type_test, propagated_outlives_requirements) {

`

966

959

`continue;

`

967

960

`}

`

968

961

`}

`

`@@ -1016,7 +1009,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {

`

1016

1009

`fn try_promote_type_test(

`

1017

1010

`&self,

`

1018

1011

`infcx: &InferCtxt<'tcx>,

`

1019

``

`-

body: &Body<'tcx>,

`

1020

1012

`type_test: &TypeTest<'tcx>,

`

1021

1013

`propagated_outlives_requirements: &mut Vec<ClosureOutlivesRequirement<'tcx>>,

`

1022

1014

`) -> bool {

`

`@@ -1179,35 +1171,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {

`

1179

1171

`Some(ClosureOutlivesSubject::Ty(ClosureOutlivesSubjectTy::bind(tcx, ty)))

`

1180

1172

`}

`

1181

1173

``

1182

``

`-

/// Returns a universally quantified region that outlives the

`

1183

``

`` -

/// value of r (r may be existentially or universally

``

1184

``

`-

/// quantified).

`

1185

``

`-

///

`

1186

``

`` -

/// Since r is (potentially) an existential region, it has some

``

1187

``

`-

/// value which may include (a) any number of points in the CFG

`

1188

``

`` -

/// and (b) any number of end('x) elements of universally

``

1189

``

`-

/// quantified regions. To convert this into a single universal

`

1190

``

`-

/// region we do as follows:

`

1191

``

`-

///

`

1192

``

`` -

/// - Ignore the CFG points in 'r. All universally quantified regions

``

1193

``

`-

/// include the CFG anyhow.

`

1194

``

`` -

/// - For each end('x) element in 'r, compute the mutual LUB, yielding

``

1195

``

`` -

/// a result 'y.

``

1196

``

`-

#[instrument(skip(self), level = "debug", ret)]

`

1197

``

`-

pub(crate) fn universal_upper_bound(&self, r: RegionVid) -> RegionVid {

`

1198

``

`-

debug!(r = %self.region_value_str(r));

`

1199

``

-

1200

``

`-

// Find the smallest universal region that contains all other

`

1201

``

`` -

// universal regions within region.

``

1202

``

`-

let mut lub = self.universal_regions.fr_fn_body;

`

1203

``

`-

let r_scc = self.constraint_sccs.scc(r);

`

1204

``

`-

for ur in self.scc_values.universal_regions_outlived_by(r_scc) {

`

1205

``

`-

lub = self.universal_region_relations.postdom_upper_bound(lub, ur);

`

1206

``

`-

}

`

1207

``

-

1208

``

`-

lub

`

1209

``

`-

}

`

1210

``

-

1211

1174

`` /// Like universal_upper_bound, but returns an approximation more suitable

``

1212

1175

`` /// for diagnostics. If r contains multiple disjoint universal regions

``

1213

1176

`` /// (e.g. 'a and 'b in fn foo<'a, 'b> { ... }, we pick the lower-numbered region.

``