fix a couple nits
- remove unneeded type ascription - fix variable name - fix typo in comment - fix `var_origins` var and function name: these are `VarInfos`
This commit is contained in:
parent
8cdc67ed23
commit
b0fc1d47d5
3 changed files with 6 additions and 7 deletions
|
@ -120,11 +120,10 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: LocalDefId) -> &BorrowCheckResult<'_> {
|
||||||
return tcx.arena.alloc(result);
|
return tcx.arena.alloc(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
let promoted: &IndexSlice<_, _> = &promoted.borrow();
|
let borrowck_result = do_mir_borrowck(tcx, input_body, &*promoted.borrow(), None).0;
|
||||||
let opt_closure_req = do_mir_borrowck(tcx, input_body, promoted, None).0;
|
|
||||||
debug!("mir_borrowck done");
|
debug!("mir_borrowck done");
|
||||||
|
|
||||||
tcx.arena.alloc(opt_closure_req)
|
tcx.arena.alloc(borrowck_result)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Perform the actual borrow checking.
|
/// Perform the actual borrow checking.
|
||||||
|
@ -215,7 +214,7 @@ fn do_mir_borrowck<'tcx>(
|
||||||
consumer_options,
|
consumer_options,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Dump MIR results into a file, if that is enabled. This let us
|
// Dump MIR results into a file, if that is enabled. This lets us
|
||||||
// write unit-tests, as well as helping with debugging.
|
// write unit-tests, as well as helping with debugging.
|
||||||
nll::dump_nll_mir(&infcx, body, ®ioncx, &opt_closure_req, &borrow_set);
|
nll::dump_nll_mir(&infcx, body, ®ioncx, &opt_closure_req, &borrow_set);
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
|
||||||
// Create the region inference context, taking ownership of the
|
// Create the region inference context, taking ownership of the
|
||||||
// region inference data that was contained in `infcx`, and the
|
// region inference data that was contained in `infcx`, and the
|
||||||
// base constraints generated by the type-check.
|
// base constraints generated by the type-check.
|
||||||
let var_origins = infcx.get_region_var_origins();
|
let var_infos = infcx.get_region_var_infos();
|
||||||
|
|
||||||
// If requested, emit legacy polonius facts.
|
// If requested, emit legacy polonius facts.
|
||||||
polonius::legacy::emit_facts(
|
polonius::legacy::emit_facts(
|
||||||
|
@ -137,7 +137,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
|
||||||
|
|
||||||
let mut regioncx = RegionInferenceContext::new(
|
let mut regioncx = RegionInferenceContext::new(
|
||||||
infcx,
|
infcx,
|
||||||
var_origins,
|
var_infos,
|
||||||
constraints,
|
constraints,
|
||||||
universal_region_relations,
|
universal_region_relations,
|
||||||
elements,
|
elements,
|
||||||
|
|
|
@ -945,7 +945,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||||
|
|
||||||
/// Clone the list of variable regions. This is used only during NLL processing
|
/// Clone the list of variable regions. This is used only during NLL processing
|
||||||
/// to put the set of region variables into the NLL region context.
|
/// to put the set of region variables into the NLL region context.
|
||||||
pub fn get_region_var_origins(&self) -> VarInfos {
|
pub fn get_region_var_infos(&self) -> VarInfos {
|
||||||
let inner = self.inner.borrow();
|
let inner = self.inner.borrow();
|
||||||
assert!(!UndoLogs::<UndoLog<'_>>::in_snapshot(&inner.undo_log));
|
assert!(!UndoLogs::<UndoLog<'_>>::in_snapshot(&inner.undo_log));
|
||||||
let storage = inner.region_constraint_storage.as_ref().expect("regions already resolved");
|
let storage = inner.region_constraint_storage.as_ref().expect("regions already resolved");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue