@@ -321,7 +321,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
321321 let mut param_args = FxHashMap :: default ( ) ;
322322 let mut param_expected = FxHashMap :: default ( ) ;
323323 let mut param_found = FxHashMap :: default ( ) ;
324- if self . can_eq ( self . param_env , ty, found) . is_ok ( ) {
324+ if self . can_eq ( self . param_env , ty, found) {
325325 // We only point at the first place where the found type was inferred.
326326 for ( i, param_ty) in sig. inputs ( ) . skip_binder ( ) . iter ( ) . skip ( 1 ) . enumerate ( ) {
327327 if def_self_ty. contains ( * param_ty) && let ty:: Param ( _) = param_ty. kind ( ) {
@@ -369,7 +369,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
369369 for ( param, ( arg, arg_ty) ) in param_args. iter ( ) {
370370 let Some ( expected) = param_expected. get ( param) else { continue ; } ;
371371 let Some ( found) = param_found. get ( param) else { continue ; } ;
372- if self . can_eq ( self . param_env , * arg_ty, * found) . is_err ( ) { continue ; }
372+ if ! self . can_eq ( self . param_env , * arg_ty, * found) { continue ; }
373373 self . emit_coerce_suggestions ( err, arg, * found, * expected, None , None ) ;
374374 }
375375
@@ -379,7 +379,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
379379 }
380380 if ty != prev
381381 && param_args. is_empty ( )
382- && self . can_eq ( self . param_env , ty, found) . is_ok ( )
382+ && self . can_eq ( self . param_env , ty, found)
383383 {
384384 // We only point at the first place where the found type was inferred.
385385 if !segment. ident . span . overlaps ( mismatch_span) {
@@ -401,7 +401,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
401401 }
402402 if ty != prev
403403 && let Some ( span) = prev_span
404- && self . can_eq ( self . param_env , ty, found) . is_ok ( )
404+ && self . can_eq ( self . param_env , ty, found)
405405 {
406406 // We only point at the first place where the found type was inferred.
407407 // We use the *previous* span because if the type is known *here* it means
@@ -764,7 +764,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
764764 if let ty:: Adt ( expected_adt, substs) = expected. kind ( ) {
765765 if let hir:: ExprKind :: Field ( base, ident) = expr. kind {
766766 let base_ty = self . typeck_results . borrow ( ) . expr_ty ( base) ;
767- if self . can_eq ( self . param_env , base_ty, expected) . is_ok ( )
767+ if self . can_eq ( self . param_env , base_ty, expected)
768768 && let Some ( base_span) = base. span . find_ancestor_inside ( expr. span )
769769 {
770770 err. span_suggestion_verbose (
@@ -1357,7 +1357,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13571357 hir:: ExprKind :: AddrOf ( hir:: BorrowKind :: Ref , _, ref expr) ,
13581358 _,
13591359 & ty:: Ref ( _, checked, _) ,
1360- ) if self . can_sub ( self . param_env , checked, expected) . is_ok ( ) => {
1360+ ) if self . can_sub ( self . param_env , checked, expected) => {
13611361 // We have `&T`, check if what was expected was `T`. If so,
13621362 // we may want to suggest removing a `&`.
13631363 if sm. is_imported ( expr. span ) {
@@ -2003,7 +2003,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
20032003 } ;
20042004 let hir:: StmtKind :: Semi ( tail_expr) = stmt. kind else { return ; } ;
20052005 let Some ( ty) = self . node_ty_opt ( tail_expr. hir_id ) else { return ; } ;
2006- if self . can_eq ( self . param_env , expected_ty, ty) . is_ok ( ) {
2006+ if self . can_eq ( self . param_env , expected_ty, ty) {
20072007 err. span_suggestion_short (
20082008 stmt. span . with_lo ( tail_expr. span . hi ( ) ) ,
20092009 "remove this semicolon" ,
0 commit comments