@@ -1058,20 +1058,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1058
1058
// Heuristics: show the diagnostics when there are no candidates in crate.
1059
1059
if let Ok ( candidate_set) = self . assemble_candidates ( stack) {
1060
1060
let mut no_candidates_apply = true ;
1061
- {
1062
- let evaluated_candidates =
1063
- candidate_set. vec . iter ( ) . map ( |c| self . evaluate_candidate ( stack, & c) ) ;
1064
-
1065
- for ec in evaluated_candidates {
1066
- match ec {
1067
- Ok ( c) => {
1068
- if c. may_apply ( ) {
1069
- no_candidates_apply = false ;
1070
- break ;
1071
- }
1072
- }
1073
- Err ( e) => return Err ( e. into ( ) ) ,
1074
- }
1061
+
1062
+ for c in candidate_set. vec . iter ( ) {
1063
+ if self . evaluate_candidate ( stack, & c) ?. may_apply ( ) {
1064
+ no_candidates_apply = false ;
1065
+ break ;
1075
1066
}
1076
1067
}
1077
1068
@@ -3182,11 +3173,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
3182
3173
assert_eq ! ( tys_a. len( ) , tys_b. len( ) ) ;
3183
3174
3184
3175
// The last field of the tuple has to exist.
3185
- let ( & a_last, a_mid) = if let Some ( x) = tys_a. split_last ( ) {
3186
- x
3187
- } else {
3188
- return Err ( Unimplemented ) ;
3189
- } ;
3176
+ let ( & a_last, a_mid) = tys_a. split_last ( ) . ok_or ( Unimplemented ) ?;
3190
3177
let & b_last = tys_b. last ( ) . unwrap ( ) ;
3191
3178
3192
3179
// Check that the source tuple with the target's
0 commit comments