From 729eb0a6e34842dba17b0be871ad961e8be6d328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:19:21 +0000 Subject: [PATCH 01/36] mark first uncovered DefineOpaqueTypes in visit_implementation_of_dispatch_from_dyn --- compiler/rustc_hir_analysis/src/coherence/builtin.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs index e5e192e0079bd..61fadc6b27395 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 => (), From c87df67088cd7e030f87474d875757d0c1b04d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:28:26 +0000 Subject: [PATCH 02/36] mark second uncovered DefineOpaqueTypes in visit_implementation_of_dispatch_from_dyn --- compiler/rustc_hir_analysis/src/coherence/builtin.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs index 61fadc6b27395..fdc9b00544e49 100644 --- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs +++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs @@ -204,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) { From c794ec36bd7da1c8a51e01065a8bdbb3d4fc01fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:33:39 +0000 Subject: [PATCH 03/36] mark first uncovered DefineOpaqueTypes in coerce_unsized_info --- compiler/rustc_hir_analysis/src/coherence/builtin.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs index fdc9b00544e49..f81e95cc7408d 100644 --- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs +++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs @@ -409,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; From c5d5bf0232e5dd8a1374d94c0f29beb329130c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:37:13 +0000 Subject: [PATCH 04/36] mark first uncovered DefineOpaqueTypes in enforce_context_effects --- compiler/rustc_hir_typeck/src/callee.rs | 1 + 1 file changed, 1 insertion(+) 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); From 408b8c071b40529a8bd785c04eac39eeb7eb76ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:40:59 +0000 Subject: [PATCH 05/36] mark first uncovered DefineOpaqueTypes in try_find_coercion_lub --- compiler/rustc_hir_typeck/src/coercion.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index 6c03bc3b57ac6..de376612b7f96 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, From f0b7ac0d08e140799266aba71b32c05412b7c294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:43:50 +0000 Subject: [PATCH 06/36] mark second uncovered DefineOpaqueTypes in try_find_coercion_lub --- compiler/rustc_hir_typeck/src/coercion.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index de376612b7f96..ce7447edb3b96 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -1193,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) From b7fecd276aa5e66ca1861cfa77e90c56eb4613bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:47:42 +0000 Subject: [PATCH 07/36] mark third uncovered DefineOpaqueTypes in try_find_coercion_lub --- compiler/rustc_hir_typeck/src/coercion.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index ce7447edb3b96..86da7cffd2312 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -1286,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)); From d759e2c13cbb74e20d3b3df74b512e301f427a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:50:24 +0000 Subject: [PATCH 08/36] mark fourth uncovered DefineOpaqueTypes in try_find_coercion_lub --- compiler/rustc_hir_typeck/src/coercion.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index 86da7cffd2312..8eee0c6f754a4 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -1301,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)) From 1febe8a761000378c99dafab522910c3bb9bf207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 19:53:40 +0000 Subject: [PATCH 09/36] mark first uncovered DefineOpaqueTypes in check_expr_struct_fields --- compiler/rustc_hir_typeck/src/expr.rs | 2 ++ 1 file changed, 2 insertions(+) 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, From db707589003309e6083cef86722faa9aee0fa4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:00:11 +0000 Subject: [PATCH 10/36] mark first uncovered DefineOpaqueTypes in instantiate_value_path --- compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs | 1 + 1 file changed, 1 insertion(+) 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, From c30d3e2b736befce04dd6ed4ea215d507173f0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:05:41 +0000 Subject: [PATCH 11/36] mark first uncovered DefineOpaqueTypes in check_argument_types --- compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 33dfa16a651fb..7783de6a75889 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, From 910446d36df5b691b4267077c74e8d4d307fa520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:05:57 +0000 Subject: [PATCH 12/36] mark first uncovered DefineOpaqueTypes in report_arg_errors --- compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 7783de6a75889..028297b4adb65 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -595,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) From fe2163c9db390887d5ac1ba47196a2d2634a28f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:10:23 +0000 Subject: [PATCH 13/36] mark first uncovered DefineOpaqueTypes in unify_receivers --- compiler/rustc_hir_typeck/src/method/confirm.rs | 1 + 1 file changed, 1 insertion(+) 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); From e3090499385bf6fa40bcabb4f95ad94af46f73a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:14:05 +0000 Subject: [PATCH 14/36] mark first uncovered DefineOpaqueTypes in matches_return_type --- compiler/rustc_hir_typeck/src/method/probe.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 74f469cb39cbf..2224274e248fd 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) From c27ac58683c89c2c966fdd93d49f7630a5fc78a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:21:11 +0000 Subject: [PATCH 15/36] mark first uncovered DefineOpaqueTypes in candidate_source --- compiler/rustc_hir_typeck/src/method/probe.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 2224274e248fd..d5f033a964b89 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -1455,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, From 1d9b5a1133036cd5119209b08da3c3b3b2cea9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:29:07 +0000 Subject: [PATCH 16/36] mark first uncovered DefineOpaqueTypes in consider_probe --- compiler/rustc_hir_typeck/src/method/probe.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index d5f033a964b89..c76b9a36f7fa7 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -1693,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) From 25e59abece82bda43255ddb856535c8afbe610e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:33:09 +0000 Subject: [PATCH 17/36] mark first uncovered DefineOpaqueTypes in can_sub --- compiler/rustc_infer/src/infer/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 4ee897ffe9843..993c2291358fb 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()) } From cc1bd62d3a60f16330f0a43159ca19c4b9dbef8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:37:56 +0000 Subject: [PATCH 18/36] mark first uncovered DefineOpaqueTypes in can_eq --- compiler/rustc_infer/src/infer/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 993c2291358fb..ca140da3e7e8f 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -917,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()) } From b5c08453d0958cc999a41b01efccf6f4f0f1cd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:43:25 +0000 Subject: [PATCH 19/36] mark first uncovered DefineOpaqueTypes in subtype_predicate --- compiler/rustc_infer/src/infer/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index ca140da3e7e8f..33eada32414fc 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -1013,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)?; From a247d09a245fb3dd548398360f41bb60d939c2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:47:18 +0000 Subject: [PATCH 20/36] mark first uncovered DefineOpaqueTypes in evaluate_nested_obligations --- compiler/rustc_trait_selection/src/traits/auto_trait.rs | 2 ++ 1 file changed, 2 insertions(+) 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(_) => (), From 53030de69d34f9eab9a8a1161c4f3a63a79f7909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:51:26 +0000 Subject: [PATCH 21/36] mark first uncovered DefineOpaqueTypes in compute_inherent_assoc_ty_args --- compiler/rustc_trait_selection/src/traits/project.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 20aa3cec87335..d085bcc1f8eb1 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(_) => { From 1e39afdcc0b42e228f59a1c1dfd178aae9e8a0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:54:48 +0000 Subject: [PATCH 22/36] mark first uncovered DefineOpaqueTypes in confirm_param_env_candidate --- compiler/rustc_trait_selection/src/traits/project.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index d085bcc1f8eb1..2a41b957d54e7 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -2354,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, From e4690120292ecdec40d5fab2a32c967a24511f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 20:59:46 +0000 Subject: [PATCH 23/36] mark first uncovered DefineOpaqueTypes in confirm_projection_candidate --- compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 952184175f4dd..8ace554dca968 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) From bc6de16b1d4cc2a16ba4256be2f1cc1bc2edacba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:02:45 +0000 Subject: [PATCH 24/36] mark first uncovered DefineOpaqueTypes in confirm_object_candidate --- compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 8ace554dca968..5175ddd76f434 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -512,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) From ad30b48529bb266ec98e20af987b27a43784e14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:06:10 +0000 Subject: [PATCH 25/36] mark first uncovered DefineOpaqueTypes in confirm_builtin_unsize_candidate --- compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 5175ddd76f434..0e1f0a0b1881b 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -1012,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) From d1f9f8431b4388edb1ba761167010b26a8588b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:11:10 +0000 Subject: [PATCH 26/36] mark second uncovered DefineOpaqueTypes in confirm_builtin_unsize_candidate --- compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 0e1f0a0b1881b..ebf169da69cbe 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -1081,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) From d21c0e8a36c9543a8e8a487add90716f4048060f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:12:23 +0000 Subject: [PATCH 27/36] mark third uncovered DefineOpaqueTypes in confirm_builtin_unsize_candidate --- compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index ebf169da69cbe..c5078a2ce79f6 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -1130,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) From 2232f6ba0dae55b3bef4803c405af40bacaddc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:13:17 +0000 Subject: [PATCH 28/36] mark fourth uncovered DefineOpaqueTypes in confirm_builtin_unsize_candidate --- compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index c5078a2ce79f6..4383c53f61416 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -1164,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) From 846be8cab60dac3209f881075135f728202690b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:26:09 +0000 Subject: [PATCH 29/36] mark first uncovered DefineOpaqueTypes in evaluate_predicate_recursively --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index cf52e6726a17c..32cbbd4fa085f 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) From 8bb12337d746fb139d0327cb03a8380ac6b82bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:26:46 +0000 Subject: [PATCH 30/36] mark second uncovered DefineOpaqueTypes in evaluate_predicate_recursively --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 32cbbd4fa085f..41571a52b1097 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -949,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) From 1f474bf3dc91a2b2030da75c12af6365ca1e4de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:27:56 +0000 Subject: [PATCH 31/36] mark third uncovered DefineOpaqueTypes in evaluate_predicate_recursively --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 41571a52b1097..6c6964d2aa366 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -983,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, From 48c5a069b8fbb5bdd4c75c5ed172ec260358eb93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:28:37 +0000 Subject: [PATCH 32/36] mark fourth uncovered DefineOpaqueTypes in evaluate_predicate_recursively --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 6c6964d2aa366..c3702726e11f5 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1015,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(), From 278ba7aec44fc32659f91653d6fbff251a7163d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:29:30 +0000 Subject: [PATCH 33/36] mark first uncovered DefineOpaqueTypes in match_normalize_trait_ref --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index c3702726e11f5..fb3b0033ce682 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1716,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) From a9b5f662a95d308ecff46042944e646195fa5797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:30:07 +0000 Subject: [PATCH 34/36] mark first uncovered DefineOpaqueTypes in match_upcast_principal --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index fb3b0033ce682..39b380e8e155a 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2539,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) From d6fa5d9537fafd39dea1cb2c29a41adb5b7e3fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:30:50 +0000 Subject: [PATCH 35/36] mark second uncovered DefineOpaqueTypes in match_upcast_principal --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 39b380e8e155a..18d5b2972f681 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2579,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) From b82ba573178ff12e2fcbe8eedc0f4da4afab31d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 29 Oct 2023 21:35:17 +0000 Subject: [PATCH 36/36] mark first uncovered DefineOpaqueTypes in fulfill_implication --- compiler/rustc_trait_selection/src/traits/specialize/mod.rs | 1 + 1 file changed, 1 insertion(+) 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)