Skip to content

Commit 1af4c64

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 168745 b: refs/heads/snap-stage3 c: fc34330 h: refs/heads/master i: 168743: bf5f6de v: v3
1 parent 4f9eeb4 commit 1af4c64

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 5e21e17d9638d14af41e27e5ca9a21c8a1bc0170
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7d3c5f020e66d01686adf98881b957be9d939021
4+
refs/heads/snap-stage3: fc343304af6ff522b9aa3b143ef6cd4bddd7e7a2
55
refs/heads/try: 5204084bd2e46af7cc6e0147430e44dd0d657bbb
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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)