Skip to content

Commit

Permalink
remove redundant function param in check_for_self_assign_helper()
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Apr 14, 2022
1 parent 15abc81 commit 6511976
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_passes/src/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
#[allow(dead_code)] // FIXME(81658): should be used + lint reinstated after #83171 relands.
fn check_for_self_assign(&mut self, assign: &'tcx hir::Expr<'tcx>) {
fn check_for_self_assign_helper<'tcx>(
tcx: TyCtxt<'tcx>,
typeck_results: &'tcx ty::TypeckResults<'tcx>,
lhs: &'tcx hir::Expr<'tcx>,
rhs: &'tcx hir::Expr<'tcx>,
Expand All @@ -177,7 +176,7 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
}
(hir::ExprKind::Field(lhs_l, ident_l), hir::ExprKind::Field(lhs_r, ident_r)) => {
if ident_l == ident_r {
return check_for_self_assign_helper(tcx, typeck_results, lhs_l, lhs_r);
return check_for_self_assign_helper(typeck_results, lhs_l, lhs_r);
}
return false;
}
Expand All @@ -188,7 +187,7 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
}

if let hir::ExprKind::Assign(lhs, rhs, _) = assign.kind {
if check_for_self_assign_helper(self.tcx, self.typeck_results(), lhs, rhs)
if check_for_self_assign_helper(self.typeck_results(), lhs, rhs)
&& !assign.span.from_expansion()
{
let is_field_assign = matches!(lhs.kind, hir::ExprKind::Field(..));
Expand Down

0 comments on commit 6511976

Please sign in to comment.