Skip to content

Commit

Permalink
Inline and remove TypeVerifier::new.
Browse files Browse the repository at this point in the history
It has a single call site.
  • Loading branch information
nnethercote committed Nov 19, 2024
1 parent 2709dc8 commit fe3c49f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub(crate) fn type_check<'a, 'tcx>(

checker.check_user_type_annotations();

let mut verifier = TypeVerifier::new(&mut checker, promoted);
let mut verifier = TypeVerifier { cx: &mut checker, promoted, last_span: body.span };
verifier.visit_body(body);

checker.typeck_mir(body);
Expand Down Expand Up @@ -465,13 +465,6 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
}

impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
fn new(
cx: &'a mut TypeChecker<'b, 'tcx>,
promoted: &'b IndexSlice<Promoted, Body<'tcx>>,
) -> Self {
TypeVerifier { promoted, last_span: cx.body.span, cx }
}

fn body(&self) -> &Body<'tcx> {
self.cx.body
}
Expand Down

0 comments on commit fe3c49f

Please sign in to comment.