Skip to content

Commit

Permalink
Don't pass universal_regions unnecessarily.
Browse files Browse the repository at this point in the history
`TypeChecker` already has it in a field.
  • Loading branch information
nnethercote committed Nov 19, 2024
1 parent b71fb5e commit 4c8a23a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions compiler/rustc_borrowck/src/type_check/input_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use tracing::{debug, instrument};

use super::{Locations, TypeChecker};
use crate::renumber::RegionCtxt;
use crate::universal_regions::{DefiningTy, UniversalRegions};
use crate::universal_regions::DefiningTy;

impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
/// Check explicit closure signature annotation,
Expand Down Expand Up @@ -124,11 +124,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
);
}

#[instrument(skip(self, body, universal_regions), level = "debug")]
#[instrument(skip(self, body), level = "debug")]
pub(super) fn equate_inputs_and_outputs(
&mut self,
body: &Body<'tcx>,
universal_regions: &UniversalRegions<'tcx>,
normalized_inputs_and_output: &[Ty<'tcx>],
) {
let (&normalized_output_ty, normalized_input_tys) =
Expand Down Expand Up @@ -161,7 +160,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
if let Some(mir_yield_ty) = body.yield_ty() {
let yield_span = body.local_decls[RETURN_PLACE].source_info.span;
self.equate_normalized_input_or_output(
universal_regions.yield_ty.unwrap(),
self.universal_regions.yield_ty.unwrap(),
mir_yield_ty,
yield_span,
);
Expand All @@ -170,7 +169,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
if let Some(mir_resume_ty) = body.resume_ty() {
let yield_span = body.local_decls[RETURN_PLACE].source_info.span;
self.equate_normalized_input_or_output(
universal_regions.resume_ty.unwrap(),
self.universal_regions.resume_ty.unwrap(),
mir_resume_ty,
yield_span,
);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub(crate) fn type_check<'a, 'tcx>(
verifier.visit_body(body);

checker.typeck_mir(body);
checker.equate_inputs_and_outputs(body, &universal_regions, &normalized_inputs_and_output);
checker.equate_inputs_and_outputs(body, &normalized_inputs_and_output);
checker.check_signature_annotation(body);

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

0 comments on commit 4c8a23a

Please sign in to comment.