diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs index e5e192e0079bd..f81e95cc7408d 100644 --- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs +++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs @@ -165,6 +165,7 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef use rustc_type_ir::TyKind::*; match (source.kind(), target.kind()) { (&Ref(r_a, _, mutbl_a), Ref(r_b, _, mutbl_b)) + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. if infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, r_a, *r_b).is_ok() && mutbl_a == *mutbl_b => {} (&RawPtr(tm_a), &RawPtr(tm_b)) if tm_a.mutbl == tm_b.mutbl => (), @@ -203,6 +204,8 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef } } + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` + // below. if let Ok(ok) = infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, ty_a, ty_b) { @@ -406,6 +409,8 @@ pub fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>, impl_did: LocalDefId) -> Coe // we may have to evaluate constraint // expressions in the course of execution.) // See e.g., #41936. + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` + // below. if let Ok(ok) = infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, a, b) { if ok.obligations.is_empty() { return None; diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs index 6b6d1574b2bf6..ef54ea467ea52 100644 --- a/compiler/rustc_hir_typeck/src/callee.rs +++ b/compiler/rustc_hir_typeck/src/callee.rs @@ -799,6 +799,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let param = callee_args.const_at(host_effect_index); let cause = self.misc(span); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. match self.at(&cause, self.param_env).eq(infer::DefineOpaqueTypes::No, effect, param) { Ok(infer::InferOk { obligations, value: () }) => { self.register_predicates(obligations); diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index 6c03bc3b57ac6..8eee0c6f754a4 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -1139,6 +1139,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // Don't reify if the function types have a LUB, i.e., they // are the same function and their parameters have a LUB. match self.commit_if_ok(|_| { + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. self.at(cause, self.param_env).lub( DefineOpaqueTypes::No, prev_ty, @@ -1191,6 +1193,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } // The signature must match. let (a_sig, b_sig) = self.normalize(new.span, (a_sig, b_sig)); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let sig = self .at(cause, self.param_env) .trace(prev_ty, new_ty) @@ -1283,6 +1286,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { return self .commit_if_ok(|_| { + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. self.at(cause, self.param_env).lub(DefineOpaqueTypes::No, prev_ty, new_ty) }) .map(|ok| self.register_infer_ok_obligations(ok)); @@ -1296,6 +1301,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { Err(e) } else { self.commit_if_ok(|_| { + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. self.at(cause, self.param_env).lub(DefineOpaqueTypes::No, prev_ty, new_ty) }) .map(|ok| self.register_infer_ok_obligations(ok)) diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index be225ceb84321..e8cbe92009b48 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -1745,6 +1745,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if let Some(_) = remaining_fields.remove(&ident) { let target_ty = self.field_ty(base_expr.span, f, args); let cause = self.misc(base_expr.span); + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. match self.at(&cause, self.param_env).sup( DefineOpaqueTypes::No, target_ty, diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs index b5a07f0d3e9ec..614d06734a0bc 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs @@ -1422,6 +1422,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // This also occurs for an enum variant on a type alias. let impl_ty = self.normalize(span, tcx.type_of(impl_def_id).instantiate(tcx, args)); let self_ty = self.normalize(span, self_ty); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. match self.at(&self.misc(span), self.param_env).eq( DefineOpaqueTypes::No, impl_ty, diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 33dfa16a651fb..028297b4adb65 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -300,6 +300,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // 3. Check if the formal type is a supertype of the checked one // and register any such obligations for future type checks + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let supertype_error = self.at(&self.misc(provided_arg.span), self.param_env).sup( DefineOpaqueTypes::No, formal_input_ty, @@ -594,6 +595,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } // Using probe here, since we don't want this subtyping to affect inference. + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let subtyping_error = self.probe(|_| { self.at(&self.misc(arg_span), self.param_env) .sup(DefineOpaqueTypes::No, formal_input_ty, coerced_ty) diff --git a/compiler/rustc_hir_typeck/src/method/confirm.rs b/compiler/rustc_hir_typeck/src/method/confirm.rs index 7c73f6a89cdb2..7c65f9f5df743 100644 --- a/compiler/rustc_hir_typeck/src/method/confirm.rs +++ b/compiler/rustc_hir_typeck/src/method/confirm.rs @@ -502,6 +502,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> { args, })), ); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. match self.at(&cause, self.param_env).sup(DefineOpaqueTypes::No, method_self_ty, self_ty) { Ok(InferOk { obligations, value: () }) => { self.register_predicates(obligations); diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 74f469cb39cbf..c76b9a36f7fa7 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -933,6 +933,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { let fty = self.instantiate_binder_with_fresh_vars(self.span, infer::FnCall, fty); if let Some(self_ty) = self_ty { + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` + // below. if self .at(&ObligationCause::dummy(), self.param_env) .sup(DefineOpaqueTypes::No, fty.inputs()[0], self_ty) @@ -1453,6 +1455,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { CandidateSource::Trait(candidate.item.container_id(self.tcx)) } TraitCandidate(trait_ref) => self.probe(|_| { + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let _ = self.at(&ObligationCause::dummy(), self.param_env).sup( DefineOpaqueTypes::No, candidate.xform_self_ty, @@ -1690,6 +1693,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { } debug!("comparing return_ty {:?} with xform ret ty {:?}", return_ty, xform_ret_ty); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. if let ProbeResult::Match = result && self .at(&ObligationCause::dummy(), self.param_env) diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 4ee897ffe9843..33eada32414fc 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -908,6 +908,7 @@ impl<'tcx> InferCtxt<'tcx> { T: at::ToTrace<'tcx>, { let origin = &ObligationCause::dummy(); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. self.probe(|_| self.at(origin, param_env).sub(DefineOpaqueTypes::No, a, b).is_ok()) } @@ -916,6 +917,7 @@ impl<'tcx> InferCtxt<'tcx> { T: at::ToTrace<'tcx>, { let origin = &ObligationCause::dummy(); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. self.probe(|_| self.at(origin, param_env).eq(DefineOpaqueTypes::No, a, b).is_ok()) } @@ -1011,6 +1013,7 @@ impl<'tcx> InferCtxt<'tcx> { let ty::SubtypePredicate { a_is_expected, a, b } = self.instantiate_binder_with_placeholders(predicate); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let ok = self.at(cause, param_env).sub_exp(DefineOpaqueTypes::No, a_is_expected, a, b)?; diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index 8096d7969f397..1704f743733b2 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -804,6 +804,8 @@ impl<'tcx> AutoTraitFinder<'tcx> { match (evaluate(c1), evaluate(c2)) { (Ok(c1), Ok(c2)) => { + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. match selcx.infcx.at(&obligation.cause, obligation.param_env).eq(DefineOpaqueTypes::No,c1, c2) { Ok(_) => (), diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 20aa3cec87335..2a41b957d54e7 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -1441,6 +1441,7 @@ pub fn compute_inherent_assoc_ty_args<'a, 'b, 'tcx>( // Infer the generic parameters of the impl by unifying the // impl type with the self type of the projection. let self_ty = alias_ty.self_ty(); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. match selcx.infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, impl_ty, self_ty) { Ok(mut ok) => obligations.append(&mut ok.obligations), Err(_) => { @@ -2353,6 +2354,7 @@ fn confirm_param_env_candidate<'cx, 'tcx>( debug!(?cache_projection, ?obligation_projection); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. match infcx.at(cause, param_env).eq( DefineOpaqueTypes::No, cache_projection, diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 952184175f4dd..4383c53f61416 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -173,6 +173,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ); obligations.extend(self.infcx.commit_if_ok(|_| { + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. self.infcx .at(&obligation.cause, obligation.param_env) .sup(DefineOpaqueTypes::No, placeholder_trait_predicate, candidate) @@ -511,6 +512,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ); nested.extend(self.infcx.commit_if_ok(|_| { + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. self.infcx .at(&obligation.cause, obligation.param_env) .sup(DefineOpaqueTypes::No, obligation_trait_ref, upcast_trait_ref) @@ -1010,6 +1012,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // Require that the traits involved in this upcast are **equal**; // only the **lifetime bound** is changed. + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let InferOk { mut obligations, .. } = self .infcx .at(&obligation.cause, obligation.param_env) @@ -1078,6 +1081,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // `[T; n]` -> `[T]` (&ty::Array(a, _), &ty::Slice(b)) => { + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let InferOk { obligations, .. } = self .infcx .at(&obligation.cause, obligation.param_env) @@ -1126,6 +1130,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { if unsizing_params.contains(i as u32) { args_b[i] } else { k } })); let new_struct = Ty::new_adt(tcx, def, args); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let InferOk { obligations, .. } = self .infcx .at(&obligation.cause, obligation.param_env) @@ -1159,6 +1164,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // last element is equal to the target. let new_tuple = Ty::new_tup_from_iter(tcx, a_mid.iter().copied().chain(iter::once(b_last))); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let InferOk { mut obligations, .. } = self .infcx .at(&obligation.cause, obligation.param_env) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index cf52e6726a17c..18d5b2972f681 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -933,6 +933,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { (Unevaluated(a), Unevaluated(b)) if a.def == b.def && tcx.def_kind(a.def) == DefKind::AssocConst => { + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. if let Ok(InferOk { obligations, value: () }) = self .infcx .at(&obligation.cause, obligation.param_env) @@ -947,6 +949,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } (_, Unevaluated(_)) | (Unevaluated(_), _) => (), (_, _) => { + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. if let Ok(InferOk { obligations, value: () }) = self .infcx .at(&obligation.cause, obligation.param_env) @@ -979,6 +983,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { match (evaluate(c1), evaluate(c2)) { (Ok(c1), Ok(c2)) => { + // FIXME(DefineOpaqueTypes): no test exercizes using + // `DefineOpaqueTypes::Yes` below. match self.infcx.at(&obligation.cause, obligation.param_env).eq( DefineOpaqueTypes::No, c1, @@ -1009,6 +1015,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } ty::PredicateKind::Ambiguous => Ok(EvaluatedToAmbig), ty::PredicateKind::Clause(ty::ClauseKind::ConstArgHasType(ct, ty)) => { + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` + // below. match self.infcx.at(&obligation.cause, obligation.param_env).eq( DefineOpaqueTypes::No, ct.ty(), @@ -1708,6 +1716,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { trait_bound, ) }); + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. self.infcx .at(&obligation.cause, obligation.param_env) .sup(DefineOpaqueTypes::No, ty::Binder::dummy(placeholder_trait_ref), trait_bound) @@ -2530,6 +2539,8 @@ impl<'tcx> SelectionContext<'_, 'tcx> { // Check that a_ty's supertrait (upcast_principal) is compatible // with the target (b_ty). ty::ExistentialPredicate::Trait(target_principal) => { + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` + // below. nested.extend( self.infcx .at(&obligation.cause, obligation.param_env) @@ -2568,6 +2579,8 @@ impl<'tcx> SelectionContext<'_, 'tcx> { if matching_projections.next().is_some() { return Ok(None); } + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` + // below. nested.extend( self.infcx .at(&obligation.cause, obligation.param_env) diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs index efab29743f4e9..c0ed3a1579fb7 100644 --- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs @@ -221,6 +221,7 @@ fn fulfill_implication<'tcx>( util::impl_subject_and_oblig(selcx, param_env, target_impl, target_args, error_cause); // do the impls unify? If not, no specialization. + // FIXME(DefineOpaqueTypes): no test exercizes using `DefineOpaqueTypes::Yes` below. let Ok(InferOk { obligations: more_obligations, .. }) = infcx .at(&ObligationCause::dummy(), param_env) .eq(DefineOpaqueTypes::No, source_trait, target_trait)