@@ -1097,7 +1097,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1097
1097
expr : & hir:: Expr < ' _ > ,
1098
1098
expr_ty : Ty < ' tcx > ,
1099
1099
expected_ty : Ty < ' tcx > ,
1100
- expected_ty_expr : Option < & ' tcx hir:: Expr < ' tcx > > ,
1101
1100
) -> bool {
1102
1101
let ty:: Adt ( adt_def, args) = expr_ty. kind ( ) else {
1103
1102
return false ;
@@ -1115,7 +1114,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1115
1114
{
1116
1115
let expr_inner_ty = args. type_at ( 0 ) ;
1117
1116
let expected_inner_ty = expected_args. type_at ( 0 ) ;
1118
- if let & ty:: Ref ( _, ty, mutability ) = expr_inner_ty. kind ( )
1117
+ if let & ty:: Ref ( _, ty, _mutability ) = expr_inner_ty. kind ( )
1119
1118
&& self . can_eq ( self . param_env , ty, expected_inner_ty)
1120
1119
{
1121
1120
let def_path = self . tcx . def_path_str ( adt_def. did ( ) ) ;
@@ -1124,14 +1123,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1124
1123
errors:: OptionResultRefMismatch :: Copied {
1125
1124
span, def_path
1126
1125
}
1127
- } else if let Some ( expected_ty_expr) = expected_ty_expr
1128
- // FIXME: suggest changes to both expressions to convert both to
1129
- // Option/Result<&T>
1130
- && mutability. is_not ( )
1131
- {
1132
- errors:: OptionResultRefMismatch :: AsRef {
1133
- span : expected_ty_expr. span . shrink_to_hi ( ) , expected_ty, expr_ty, def_path
1134
- }
1135
1126
} else if let Some ( clone_did) = self . tcx . lang_items ( ) . clone_trait ( )
1136
1127
&& rustc_trait_selection:: traits:: type_known_to_meet_bound_modulo_regions (
1137
1128
self ,
0 commit comments