Skip to content

Commit 29d0390

Browse files
committed
remove unnecessary select_obligations_where_possible
this was previously used for opaque types but became unnecessary after #89024
1 parent 2b730a3 commit 29d0390

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

compiler/rustc_typeck/src/check/wfcheck.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use rustc_span::symbol::{sym, Ident, Symbol};
2525
use rustc_span::{Span, DUMMY_SP};
2626
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
2727
use rustc_trait_selection::traits::query::normalize::AtExt;
28-
use rustc_trait_selection::traits::{self, ObligationCause, ObligationCauseCode, WellFormedLoc};
2928
use rustc_trait_selection::traits::query::NoSolution;
29+
use rustc_trait_selection::traits::{self, ObligationCause, ObligationCauseCode, WellFormedLoc};
3030

3131
use std::cell::LazyCell;
3232
use std::convert::TryInto;
@@ -1090,7 +1090,7 @@ fn check_type_defn<'tcx, F>(
10901090
}
10911091
}
10921092

1093-
check_where_clauses(fcx, item.span, item.def_id, None);
1093+
check_where_clauses(fcx, item.span, item.def_id);
10941094

10951095
// No implied bounds in a struct definition.
10961096
FxHashSet::default()
@@ -1118,7 +1118,7 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) {
11181118

11191119
// FIXME: this shouldn't use an `FnCtxt` at all.
11201120
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);
11221122

11231123
FxHashSet::default()
11241124
});
@@ -1260,7 +1260,7 @@ fn check_impl<'tcx>(
12601260
}
12611261
}
12621262

1263-
check_where_clauses(fcx, item.span, item.def_id, None);
1263+
check_where_clauses(fcx, item.span, item.def_id);
12641264

12651265
impl_implied_bounds(tcx, fcx.param_env, item.def_id, item.span)
12661266
});
@@ -1272,7 +1272,6 @@ fn check_where_clauses<'tcx, 'fcx>(
12721272
fcx: &FnCtxt<'fcx, 'tcx>,
12731273
span: Span,
12741274
def_id: LocalDefId,
1275-
return_ty: Option<(Ty<'tcx>, Span)>,
12761275
) {
12771276
let tcx = fcx.tcx;
12781277

@@ -1443,12 +1442,6 @@ fn check_where_clauses<'tcx, 'fcx>(
14431442

14441443
let predicates = predicates.instantiate_identity(tcx);
14451444

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-
14521445
let predicates = fcx.normalize_associated_types_in(span, predicates);
14531446

14541447
debug!(?predicates.predicates);
@@ -1529,7 +1522,7 @@ fn check_fn_or_method<'fcx, 'tcx>(
15291522

15301523
debug!(?implied_bounds);
15311524

1532-
check_where_clauses(fcx, span, def_id, Some((sig.output(), hir_decl.output.span())));
1525+
check_where_clauses(fcx, span, def_id);
15331526
}
15341527

15351528
const HELP_FOR_SELF_TYPE: &str = "consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, \

0 commit comments

Comments
 (0)