remove useless local variables
This commit is contained in:
parent
274b5249eb
commit
eca2789f57
1 changed files with 8 additions and 11 deletions
|
@ -215,8 +215,7 @@ fn do_mir_borrowck<'tcx>(
|
||||||
nll::replace_regions_in_mir(&infcx, param_env, &mut body_owned, &mut promoted);
|
nll::replace_regions_in_mir(&infcx, param_env, &mut body_owned, &mut promoted);
|
||||||
let body = &body_owned; // no further changes
|
let body = &body_owned; // no further changes
|
||||||
|
|
||||||
let location_table_owned = LocationTable::new(body);
|
let location_table = LocationTable::new(body);
|
||||||
let location_table = &location_table_owned;
|
|
||||||
|
|
||||||
let move_data = MoveData::gather_moves(body, tcx, param_env, |_| true);
|
let move_data = MoveData::gather_moves(body, tcx, param_env, |_| true);
|
||||||
let promoted_move_data = promoted
|
let promoted_move_data = promoted
|
||||||
|
@ -248,7 +247,7 @@ fn do_mir_borrowck<'tcx>(
|
||||||
free_regions,
|
free_regions,
|
||||||
body,
|
body,
|
||||||
&promoted,
|
&promoted,
|
||||||
location_table,
|
&location_table,
|
||||||
param_env,
|
param_env,
|
||||||
&mut flow_inits,
|
&mut flow_inits,
|
||||||
&mdpe.move_data,
|
&mdpe.move_data,
|
||||||
|
@ -312,7 +311,7 @@ fn do_mir_borrowck<'tcx>(
|
||||||
param_env,
|
param_env,
|
||||||
body: promoted_body,
|
body: promoted_body,
|
||||||
move_data: &move_data,
|
move_data: &move_data,
|
||||||
location_table, // no need to create a real one for the promoted, it is not used
|
location_table: &location_table, // no need to create a real one for the promoted, it is not used
|
||||||
movable_coroutine,
|
movable_coroutine,
|
||||||
fn_self_span_reported: Default::default(),
|
fn_self_span_reported: Default::default(),
|
||||||
locals_are_invalidated_at_exit,
|
locals_are_invalidated_at_exit,
|
||||||
|
@ -353,7 +352,7 @@ fn do_mir_borrowck<'tcx>(
|
||||||
param_env,
|
param_env,
|
||||||
body,
|
body,
|
||||||
move_data: &mdpe.move_data,
|
move_data: &mdpe.move_data,
|
||||||
location_table,
|
location_table: &location_table,
|
||||||
movable_coroutine,
|
movable_coroutine,
|
||||||
locals_are_invalidated_at_exit,
|
locals_are_invalidated_at_exit,
|
||||||
fn_self_span_reported: Default::default(),
|
fn_self_span_reported: Default::default(),
|
||||||
|
@ -455,7 +454,7 @@ fn do_mir_borrowck<'tcx>(
|
||||||
promoted,
|
promoted,
|
||||||
borrow_set,
|
borrow_set,
|
||||||
region_inference_context: regioncx,
|
region_inference_context: regioncx,
|
||||||
location_table: polonius_input.as_ref().map(|_| location_table_owned),
|
location_table: polonius_input.as_ref().map(|_| location_table),
|
||||||
input_facts: polonius_input,
|
input_facts: polonius_input,
|
||||||
output_facts,
|
output_facts,
|
||||||
}))
|
}))
|
||||||
|
@ -1040,9 +1039,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||||
flow_state: &Flows<'cx, 'tcx>,
|
flow_state: &Flows<'cx, 'tcx>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let mut error_reported = false;
|
let mut error_reported = false;
|
||||||
let tcx = self.infcx.tcx;
|
let borrow_set = Rc::clone(&self.borrow_set);
|
||||||
let body = self.body;
|
|
||||||
let borrow_set = self.borrow_set.clone();
|
|
||||||
|
|
||||||
// Use polonius output if it has been enabled.
|
// Use polonius output if it has been enabled.
|
||||||
let mut polonius_output;
|
let mut polonius_output;
|
||||||
|
@ -1059,8 +1056,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||||
|
|
||||||
each_borrow_involving_path(
|
each_borrow_involving_path(
|
||||||
self,
|
self,
|
||||||
tcx,
|
self.infcx.tcx,
|
||||||
body,
|
self.body,
|
||||||
location,
|
location,
|
||||||
(sd, place_span.0),
|
(sd, place_span.0),
|
||||||
&borrow_set,
|
&borrow_set,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue