@@ -322,7 +322,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
322
322
lhs_expr. span ,
323
323
format ! ( "cannot use `{}` on type `{}`" , s, lhs_ty_str) ,
324
324
) ;
325
- self . note_unmet_impls_on_type ( & mut err, errors, false ) ;
325
+ self . note_unmet_impls_on_type ( & mut err, & errors, false ) ;
326
326
( err, None )
327
327
}
328
328
Op :: BinOp ( bin_op) => {
@@ -382,7 +382,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
382
382
err. span_label ( rhs_expr. span , rhs_ty_str) ;
383
383
}
384
384
let suggest_derive = self . can_eq ( self . param_env , lhs_ty, rhs_ty) ;
385
- self . note_unmet_impls_on_type ( & mut err, errors, suggest_derive) ;
385
+ self . note_unmet_impls_on_type ( & mut err, & errors, suggest_derive) ;
386
386
( err, output_def_id)
387
387
}
388
388
} ;
@@ -582,22 +582,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
582
582
// concatenation (e.g., "Hello " + "World!"). This means
583
583
// we don't want the note in the else clause to be emitted
584
584
} else if lhs_ty. has_non_region_param ( ) {
585
- // Look for a TraitPredicate in the Fulfillment errors,
586
- // and use it to generate a suggestion.
587
- //
588
- // Note that lookup_op_method must be called again but
589
- // with a specific rhs_ty instead of a placeholder so
590
- // the resulting predicate generates a more specific
591
- // suggestion for the user.
592
- let errors = self
593
- . lookup_op_method (
594
- ( lhs_expr, lhs_ty) ,
595
- Some ( ( rhs_expr, rhs_ty) ) ,
596
- lang_item_for_binop ( self . tcx , op) ,
597
- op. span ( ) ,
598
- expected,
599
- )
600
- . unwrap_err ( ) ;
601
585
if !errors. is_empty ( ) {
602
586
for error in errors {
603
587
if let Some ( trait_pred) =
@@ -946,7 +930,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
946
930
ty:: Str | ty:: Never | ty:: Char | ty:: Tuple ( _) | ty:: Array ( _, _) => { }
947
931
ty:: Ref ( _, lty, _) if * lty. kind ( ) == ty:: Str => { }
948
932
_ => {
949
- self . note_unmet_impls_on_type ( & mut err, errors, true ) ;
933
+ self . note_unmet_impls_on_type ( & mut err, & errors, true ) ;
950
934
}
951
935
}
952
936
}
0 commit comments