Skip to content

Commit 412a3ca

Browse files
committed
Don't pass universal_regions unnecessarily.
`TypeChecker` already has it in a field.
1 parent fbab782 commit 412a3ca

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

compiler/rustc_borrowck/src/type_check/input_output.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use tracing::{debug, instrument};
1919

2020
use super::{Locations, TypeChecker};
2121
use crate::renumber::RegionCtxt;
22-
use crate::universal_regions::{DefiningTy, UniversalRegions};
22+
use crate::universal_regions::DefiningTy;
2323

2424
impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2525
/// Check explicit closure signature annotation,
@@ -124,11 +124,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
124124
);
125125
}
126126

127-
#[instrument(skip(self, body, universal_regions), level = "debug")]
127+
#[instrument(skip(self, body), level = "debug")]
128128
pub(super) fn equate_inputs_and_outputs(
129129
&mut self,
130130
body: &Body<'tcx>,
131-
universal_regions: &UniversalRegions<'tcx>,
132131
normalized_inputs_and_output: &[Ty<'tcx>],
133132
) {
134133
let (&normalized_output_ty, normalized_input_tys) =
@@ -161,7 +160,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
161160
if let Some(mir_yield_ty) = body.yield_ty() {
162161
let yield_span = body.local_decls[RETURN_PLACE].source_info.span;
163162
self.equate_normalized_input_or_output(
164-
universal_regions.yield_ty.unwrap(),
163+
self.universal_regions.yield_ty.unwrap(),
165164
mir_yield_ty,
166165
yield_span,
167166
);
@@ -170,7 +169,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
170169
if let Some(mir_resume_ty) = body.resume_ty() {
171170
let yield_span = body.local_decls[RETURN_PLACE].source_info.span;
172171
self.equate_normalized_input_or_output(
173-
universal_regions.resume_ty.unwrap(),
172+
self.universal_regions.resume_ty.unwrap(),
174173
mir_resume_ty,
175174
yield_span,
176175
);

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub(crate) fn type_check<'a, 'tcx>(
180180
verifier.visit_body(body);
181181

182182
checker.typeck_mir(body);
183-
checker.equate_inputs_and_outputs(body, &universal_regions, &normalized_inputs_and_output);
183+
checker.equate_inputs_and_outputs(body, &normalized_inputs_and_output);
184184
checker.check_signature_annotation(body);
185185

186186
liveness::generate(&mut checker, body, &elements, flow_inits, move_data);

0 commit comments

Comments
 (0)