@@ -1097,7 +1097,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10971097 expr : & hir:: Expr < ' _ > ,
10981098 expr_ty : Ty < ' tcx > ,
10991099 expected_ty : Ty < ' tcx > ,
1100- expected_ty_expr : Option < & ' tcx hir:: Expr < ' tcx > > ,
11011100 ) -> bool {
11021101 let ty:: Adt ( adt_def, args) = expr_ty. kind ( ) else {
11031102 return false ;
@@ -1115,7 +1114,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11151114 {
11161115 let expr_inner_ty = args. type_at ( 0 ) ;
11171116 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 ( )
11191118 && self . can_eq ( self . param_env , ty, expected_inner_ty)
11201119 {
11211120 let def_path = self . tcx . def_path_str ( adt_def. did ( ) ) ;
@@ -1124,14 +1123,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11241123 errors:: OptionResultRefMismatch :: Copied {
11251124 span, def_path
11261125 }
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- }
11351126 } else if let Some ( clone_did) = self . tcx . lang_items ( ) . clone_trait ( )
11361127 && rustc_trait_selection:: traits:: type_known_to_meet_bound_modulo_regions (
11371128 self ,
0 commit comments