Skip to content

Commit b0fc1d4

Browse files
committed
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`
1 parent 8cdc67e commit b0fc1d4

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

compiler/rustc_borrowck/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,10 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: LocalDefId) -> &BorrowCheckResult<'_> {
120120
return tcx.arena.alloc(result);
121121
}
122122

123-
let promoted: &IndexSlice<_, _> = &promoted.borrow();
124-
let opt_closure_req = do_mir_borrowck(tcx, input_body, promoted, None).0;
123+
let borrowck_result = do_mir_borrowck(tcx, input_body, &*promoted.borrow(), None).0;
125124
debug!("mir_borrowck done");
126125

127-
tcx.arena.alloc(opt_closure_req)
126+
tcx.arena.alloc(borrowck_result)
128127
}
129128

130129
/// Perform the actual borrow checking.
@@ -215,7 +214,7 @@ fn do_mir_borrowck<'tcx>(
215214
consumer_options,
216215
);
217216

218-
// Dump MIR results into a file, if that is enabled. This let us
217+
// Dump MIR results into a file, if that is enabled. This lets us
219218
// write unit-tests, as well as helping with debugging.
220219
nll::dump_nll_mir(&infcx, body, &regioncx, &opt_closure_req, &borrow_set);
221220

compiler/rustc_borrowck/src/nll.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
121121
// Create the region inference context, taking ownership of the
122122
// region inference data that was contained in `infcx`, and the
123123
// base constraints generated by the type-check.
124-
let var_origins = infcx.get_region_var_origins();
124+
let var_infos = infcx.get_region_var_infos();
125125

126126
// If requested, emit legacy polonius facts.
127127
polonius::legacy::emit_facts(
@@ -137,7 +137,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
137137

138138
let mut regioncx = RegionInferenceContext::new(
139139
infcx,
140-
var_origins,
140+
var_infos,
141141
constraints,
142142
universal_region_relations,
143143
elements,

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ impl<'tcx> InferCtxt<'tcx> {
945945

946946
/// Clone the list of variable regions. This is used only during NLL processing
947947
/// to put the set of region variables into the NLL region context.
948-
pub fn get_region_var_origins(&self) -> VarInfos {
948+
pub fn get_region_var_infos(&self) -> VarInfos {
949949
let inner = self.inner.borrow();
950950
assert!(!UndoLogs::<UndoLog<'_>>::in_snapshot(&inner.undo_log));
951951
let storage = inner.region_constraint_storage.as_ref().expect("regions already resolved");

0 commit comments

Comments
 (0)