@@ -25,8 +25,8 @@ use rustc_span::symbol::{sym, Ident, Symbol};
25
25
use rustc_span:: { Span , DUMMY_SP } ;
26
26
use rustc_trait_selection:: traits:: query:: evaluate_obligation:: InferCtxtExt as _;
27
27
use rustc_trait_selection:: traits:: query:: normalize:: AtExt ;
28
- use rustc_trait_selection:: traits:: { self , ObligationCause , ObligationCauseCode , WellFormedLoc } ;
29
28
use rustc_trait_selection:: traits:: query:: NoSolution ;
29
+ use rustc_trait_selection:: traits:: { self , ObligationCause , ObligationCauseCode , WellFormedLoc } ;
30
30
31
31
use std:: cell:: LazyCell ;
32
32
use std:: convert:: TryInto ;
@@ -1090,7 +1090,7 @@ fn check_type_defn<'tcx, F>(
1090
1090
}
1091
1091
}
1092
1092
1093
- check_where_clauses ( fcx, item. span , item. def_id , None ) ;
1093
+ check_where_clauses ( fcx, item. span , item. def_id ) ;
1094
1094
1095
1095
// No implied bounds in a struct definition.
1096
1096
FxHashSet :: default ( )
@@ -1118,7 +1118,7 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) {
1118
1118
1119
1119
// FIXME: this shouldn't use an `FnCtxt` at all.
1120
1120
for_item ( tcx, item) . with_fcx ( |fcx| {
1121
- check_where_clauses ( fcx, item. span , item. def_id , None ) ;
1121
+ check_where_clauses ( fcx, item. span , item. def_id ) ;
1122
1122
1123
1123
FxHashSet :: default ( )
1124
1124
} ) ;
@@ -1260,7 +1260,7 @@ fn check_impl<'tcx>(
1260
1260
}
1261
1261
}
1262
1262
1263
- check_where_clauses ( fcx, item. span , item. def_id , None ) ;
1263
+ check_where_clauses ( fcx, item. span , item. def_id ) ;
1264
1264
1265
1265
impl_implied_bounds ( tcx, fcx. param_env , item. def_id , item. span )
1266
1266
} ) ;
@@ -1272,7 +1272,6 @@ fn check_where_clauses<'tcx, 'fcx>(
1272
1272
fcx : & FnCtxt < ' fcx , ' tcx > ,
1273
1273
span : Span ,
1274
1274
def_id : LocalDefId ,
1275
- return_ty : Option < ( Ty < ' tcx > , Span ) > ,
1276
1275
) {
1277
1276
let tcx = fcx. tcx ;
1278
1277
@@ -1443,12 +1442,6 @@ fn check_where_clauses<'tcx, 'fcx>(
1443
1442
1444
1443
let predicates = predicates. instantiate_identity ( tcx) ;
1445
1444
1446
- if let Some ( ( return_ty, _) ) = return_ty {
1447
- if return_ty. has_infer_types_or_consts ( ) {
1448
- fcx. select_obligations_where_possible ( false , |_| { } ) ;
1449
- }
1450
- }
1451
-
1452
1445
let predicates = fcx. normalize_associated_types_in ( span, predicates) ;
1453
1446
1454
1447
debug ! ( ?predicates. predicates) ;
@@ -1529,7 +1522,7 @@ fn check_fn_or_method<'fcx, 'tcx>(
1529
1522
1530
1523
debug ! ( ?implied_bounds) ;
1531
1524
1532
- check_where_clauses ( fcx, span, def_id, Some ( ( sig . output ( ) , hir_decl . output . span ( ) ) ) ) ;
1525
+ check_where_clauses ( fcx, span, def_id) ;
1533
1526
}
1534
1527
1535
1528
const HELP_FOR_SELF_TYPE : & str = "consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, \
0 commit comments