Skip to content

Commit e0ec66a

Browse files
committed
Use DefineOpaqueTypes::Yes where a fresh InferCtxt with an empty defining opaque types list is used
1 parent 241fc13 commit e0ec66a

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_hir_analysis/src/coherence

1 file changed

+3
-3
lines changed

compiler/rustc_hir_analysis/src/coherence/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fn visit_implementation_of_dispatch_from_dyn(checker: &Checker<'_>) -> Result<()
190190
use rustc_type_ir::TyKind::*;
191191
match (source.kind(), target.kind()) {
192192
(&Ref(r_a, _, mutbl_a), Ref(r_b, _, mutbl_b))
193-
if infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, r_a, *r_b).is_ok()
193+
if infcx.at(&cause, param_env).eq(DefineOpaqueTypes::Yes, r_a, *r_b).is_ok()
194194
&& mutbl_a == *mutbl_b =>
195195
{
196196
Ok(())
@@ -231,7 +231,7 @@ fn visit_implementation_of_dispatch_from_dyn(checker: &Checker<'_>) -> Result<()
231231
}
232232

233233
if let Ok(ok) =
234-
infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, ty_a, ty_b)
234+
infcx.at(&cause, param_env).eq(DefineOpaqueTypes::Yes, ty_a, ty_b)
235235
{
236236
if ok.obligations.is_empty() {
237237
res = Err(tcx.dcx().emit_err(errors::DispatchFromDynZST {
@@ -437,7 +437,7 @@ pub fn coerce_unsized_info<'tcx>(
437437
// we may have to evaluate constraint
438438
// expressions in the course of execution.)
439439
// See e.g., #41936.
440-
if let Ok(ok) = infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, a, b) {
440+
if let Ok(ok) = infcx.at(&cause, param_env).eq(DefineOpaqueTypes::Yes, a, b) {
441441
if ok.obligations.is_empty() {
442442
return None;
443443
}

0 commit comments

Comments
 (0)