diff options
| author | lcnr <rust@lcnr.de> | 2022-07-07 13:43:01 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-07-15 16:40:39 +0200 |
| commit | 29d0390b97235e64f43bd50cf4282c26625e7e5a (patch) | |
| tree | b51f7476a48d52cb8277de07e04a05eedd09042b | |
| parent | 2b730a3610850336443ff5b9ca4e92430f8b0cee (diff) | |
| download | rust-29d0390b97235e64f43bd50cf4282c26625e7e5a.tar.gz rust-29d0390b97235e64f43bd50cf4282c26625e7e5a.zip | |
remove unnecessary `select_obligations_where_possible`
this was previously used for opaque types but became unnecessary after #89024
| -rw-r--r-- | compiler/rustc_typeck/src/check/wfcheck.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index d6ef9711dbb..a05cf232137 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -25,8 +25,8 @@ use rustc_span::symbol::{sym, Ident, Symbol}; use rustc_span::{Span, DUMMY_SP}; use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; use rustc_trait_selection::traits::query::normalize::AtExt; -use rustc_trait_selection::traits::{self, ObligationCause, ObligationCauseCode, WellFormedLoc}; use rustc_trait_selection::traits::query::NoSolution; +use rustc_trait_selection::traits::{self, ObligationCause, ObligationCauseCode, WellFormedLoc}; use std::cell::LazyCell; use std::convert::TryInto; @@ -1090,7 +1090,7 @@ fn check_type_defn<'tcx, F>( } } - check_where_clauses(fcx, item.span, item.def_id, None); + check_where_clauses(fcx, item.span, item.def_id); // No implied bounds in a struct definition. FxHashSet::default() @@ -1118,7 +1118,7 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) { // FIXME: this shouldn't use an `FnCtxt` at all. for_item(tcx, item).with_fcx(|fcx| { - check_where_clauses(fcx, item.span, item.def_id, None); + check_where_clauses(fcx, item.span, item.def_id); FxHashSet::default() }); @@ -1260,7 +1260,7 @@ fn check_impl<'tcx>( } } - check_where_clauses(fcx, item.span, item.def_id, None); + check_where_clauses(fcx, item.span, item.def_id); impl_implied_bounds(tcx, fcx.param_env, item.def_id, item.span) }); @@ -1272,7 +1272,6 @@ fn check_where_clauses<'tcx, 'fcx>( fcx: &FnCtxt<'fcx, 'tcx>, span: Span, def_id: LocalDefId, - return_ty: Option<(Ty<'tcx>, Span)>, ) { let tcx = fcx.tcx; @@ -1443,12 +1442,6 @@ fn check_where_clauses<'tcx, 'fcx>( let predicates = predicates.instantiate_identity(tcx); - if let Some((return_ty, _)) = return_ty { - if return_ty.has_infer_types_or_consts() { - fcx.select_obligations_where_possible(false, |_| {}); - } - } - let predicates = fcx.normalize_associated_types_in(span, predicates); debug!(?predicates.predicates); @@ -1529,7 +1522,7 @@ fn check_fn_or_method<'fcx, 'tcx>( debug!(?implied_bounds); - check_where_clauses(fcx, span, def_id, Some((sig.output(), hir_decl.output.span()))); + check_where_clauses(fcx, span, def_id); } const HELP_FOR_SELF_TYPE: &str = "consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, \ |
