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:
Rémy Rakic 2024-12-29 23:14:22 +00:00
parent 8cdc67ed23
commit b0fc1d47d5
3 changed files with 6 additions and 7 deletions

View file

@ -120,11 +120,10 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: LocalDefId) -> &BorrowCheckResult<'_> {
return tcx.arena.alloc(result);
}
let promoted: &IndexSlice<_, _> = &promoted.borrow();
let opt_closure_req = do_mir_borrowck(tcx, input_body, promoted, None).0;
let borrowck_result = do_mir_borrowck(tcx, input_body, &*promoted.borrow(), None).0;
debug!("mir_borrowck done");
tcx.arena.alloc(opt_closure_req)
tcx.arena.alloc(borrowck_result)
}
/// Perform the actual borrow checking.
@ -215,7 +214,7 @@ fn do_mir_borrowck<'tcx>(
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.
nll::dump_nll_mir(&infcx, body, &regioncx, &opt_closure_req, &borrow_set);

View file

@ -121,7 +121,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
// Create the region inference context, taking ownership of the
// region inference data that was contained in `infcx`, and the
// 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.
polonius::legacy::emit_facts(
@ -137,7 +137,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
let mut regioncx = RegionInferenceContext::new(
infcx,
var_origins,
var_infos,
constraints,
universal_region_relations,
elements,

View file

@ -945,7 +945,7 @@ impl<'tcx> InferCtxt<'tcx> {
/// 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.
pub fn get_region_var_origins(&self) -> VarInfos {
pub fn get_region_var_infos(&self) -> VarInfos {
let inner = self.inner.borrow();
assert!(!UndoLogs::<UndoLog<'_>>::in_snapshot(&inner.undo_log));
let storage = inner.region_constraint_storage.as_ref().expect("regions already resolved");