Skip to content

Commit 70f7157

Browse files
committed
rename fn param to clarify its adjustments on a
1 parent 8c19f74 commit 70f7157

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -800,25 +800,25 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
800800
&self,
801801
a: ty::PolyFnSig<'tcx>,
802802
b: ty::PolyFnSig<'tcx>,
803-
adjustment: Option<Adjust>,
803+
a_adjustment: Option<Adjust>,
804804
) -> CoerceResult<'tcx> {
805805
let a_ty = Ty::new_fn_ptr(self.tcx, a);
806806
let b_ty = Ty::new_fn_ptr(self.tcx, b);
807807

808808
// Handle coercing `fn(..)` to `unsafe fn(..)`
809809
if a.safety().is_safe() && b.safety().is_unsafe() {
810810
let unsafe_a_ty = self.tcx.safe_to_unsafe_fn_ty(a);
811-
let adjustment = adjustment.map(|kind| Adjustment { kind, target: a_ty });
811+
let a_adjustment = a_adjustment.map(|kind| Adjustment { kind, target: a_ty });
812812

813813
self.unify_and(
814814
unsafe_a_ty,
815815
b_ty,
816-
adjustment,
816+
a_adjustment,
817817
Adjust::Pointer(PointerCoercion::UnsafeFnPointer),
818818
)
819819
} else {
820-
match adjustment {
821-
Some(adjust) => self.unify_and(a_ty, b_ty, [], adjust),
820+
match a_adjustment {
821+
Some(a_adjust) => self.unify_and(a_ty, b_ty, [], a_adjust),
822822
None => self.unify(a_ty, b_ty),
823823
}
824824
}

0 commit comments

Comments
 (0)