Skip to content

Commit d1fcc06

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 168658 b: refs/heads/batch c: fc34330 h: refs/heads/master v: v3
1 parent cd94062 commit d1fcc06

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: 7d3c5f020e66d01686adf98881b957be9d939021
32+
refs/heads/batch: fc343304af6ff522b9aa3b143ef6cd4bddd7e7a2
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970

branches/batch/src/librustc_typeck/check/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,7 +2524,6 @@ fn try_index_step<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
25242524
}
25252525

25262526
let input_ty = fcx.infcx().next_ty_var();
2527-
let return_ty = fcx.infcx().next_ty_var();
25282527

25292528
// Try `IndexMut` first, if preferred.
25302529
let method = match (lvalue_pref, fcx.tcx().lang_items.index_mut_trait()) {
@@ -2536,7 +2535,7 @@ fn try_index_step<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
25362535
trait_did,
25372536
adjustment.clone(),
25382537
adjusted_ty,
2539-
Some(vec![input_ty, return_ty]))
2538+
Some(vec![input_ty]))
25402539
}
25412540
_ => None,
25422541
};
@@ -2551,17 +2550,17 @@ fn try_index_step<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
25512550
trait_did,
25522551
adjustment,
25532552
adjusted_ty,
2554-
Some(vec![input_ty, return_ty]))
2553+
Some(vec![input_ty]))
25552554
}
25562555
(method, _) => method,
25572556
};
25582557

25592558
// If some lookup succeeds, write callee into table and extract index/element
25602559
// type from the method signature.
25612560
// If some lookup succeeded, install method in table
2562-
method.map(|method| {
2563-
make_overloaded_lvalue_return_type(fcx, Some(method_call), Some(method));
2564-
(input_ty, return_ty)
2561+
method.and_then(|method| {
2562+
make_overloaded_lvalue_return_type(fcx, Some(method_call), Some(method)).
2563+
map(|ret| (input_ty, ret.ty))
25652564
})
25662565
}
25672566

0 commit comments

Comments
 (0)