Skip to content

Commit 8b3a681

Browse files
committed
minor: pick a suitable var name
1 parent c0a5a85 commit 8b3a681

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_hir_typeck/src/method/suggest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15881588
};
15891589
if let SelfSource::MethodCall(_) = source {
15901590
let first_arg = static_candidates.get(0).and_then(|candidate_source| {
1591-
let (assoc_did, impl_ty) = match candidate_source {
1591+
let (assoc_did, self_ty) = match candidate_source {
15921592
CandidateSource::Impl(impl_did) => {
15931593
(*impl_did, self.tcx.type_of(*impl_did).instantiate_identity())
15941594
}
@@ -1606,7 +1606,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16061606
sig.inputs().skip_binder().get(0).and_then(|first| {
16071607
// if the type of first arg is the same as the current impl type, we should take the first arg into assoc function
16081608
let first_ty = first.peel_refs();
1609-
if first_ty == impl_ty || first_ty == self.tcx.types.self_param {
1609+
if first_ty == self_ty || first_ty == self.tcx.types.self_param {
16101610
Some(first.ref_mutability().map_or("", |mutbl| mutbl.ref_prefix_str()))
16111611
} else {
16121612
None

0 commit comments

Comments
 (0)