1
Fork 0

Replace (Body, DefId) with Body where possible

A `Body` now contains its `MirSource`, which in turn contains the
`DefId` of the item associated with the `Body`.
This commit is contained in:
Dylan MacKenzie 2020-10-04 15:22:23 -07:00
parent 4ccf5f731b
commit e72e43c730
25 changed files with 159 additions and 232 deletions

View file

@ -203,7 +203,7 @@ fn do_mir_borrowck<'a, 'tcx>(
let mdpe = MoveDataParamEnv { move_data, param_env };
let mut flow_inits = MaybeInitializedPlaces::new(tcx, &body, &mdpe)
.into_engine(tcx, &body, def.did.to_def_id())
.into_engine(tcx, &body)
.pass_name("borrowck")
.iterate_to_fixpoint()
.into_results_cursor(&body);
@ -221,7 +221,6 @@ fn do_mir_borrowck<'a, 'tcx>(
nll_errors,
} = nll::compute_regions(
infcx,
def.did,
free_regions,
body,
&promoted,
@ -242,7 +241,6 @@ fn do_mir_borrowck<'a, 'tcx>(
nll::dump_annotation(
infcx,
&body,
def.did.to_def_id(),
&regioncx,
&opt_closure_req,
&opaque_type_values,
@ -257,15 +255,15 @@ fn do_mir_borrowck<'a, 'tcx>(
let regioncx = Rc::new(regioncx);
let flow_borrows = Borrows::new(tcx, &body, regioncx.clone(), &borrow_set)
.into_engine(tcx, &body, def.did.to_def_id())
.into_engine(tcx, &body)
.pass_name("borrowck")
.iterate_to_fixpoint();
let flow_uninits = MaybeUninitializedPlaces::new(tcx, &body, &mdpe)
.into_engine(tcx, &body, def.did.to_def_id())
.into_engine(tcx, &body)
.pass_name("borrowck")
.iterate_to_fixpoint();
let flow_ever_inits = EverInitializedPlaces::new(tcx, &body, &mdpe)
.into_engine(tcx, &body, def.did.to_def_id())
.into_engine(tcx, &body)
.pass_name("borrowck")
.iterate_to_fixpoint();