Skip to content

Commit 53d3fce

Browse files
committed
Use DefineOpaqueTypes::Yes since we are guaranteed to error already
1 parent c1645b2 commit 53d3fce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_hir_typeck/src/demand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
400400
// what our ideal rcvr ty would look like.
401401
let _ = self
402402
.at(&ObligationCause::dummy(), self.param_env)
403-
.eq(DefineOpaqueTypes::No, method.sig.inputs()[idx + 1], arg_ty)
403+
.eq(DefineOpaqueTypes::Yes, method.sig.inputs()[idx + 1], arg_ty)
404404
.ok()?;
405405
self.select_obligations_where_possible(|errs| {
406406
// Yeet the errors, we're already reporting errors.
@@ -479,7 +479,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
479479
.and_then(|method| {
480480
let _ = self
481481
.at(&ObligationCause::dummy(), self.param_env)
482-
.eq(DefineOpaqueTypes::No, ideal_rcvr_ty, expected_ty)
482+
.eq(DefineOpaqueTypes::Yes, ideal_rcvr_ty, expected_ty)
483483
.ok()?;
484484
Some(method)
485485
});

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
560560
// Using probe here, since we don't want this subtyping to affect inference.
561561
let subtyping_error = self.probe(|_| {
562562
self.at(&self.misc(arg_span), self.param_env)
563-
.sup(DefineOpaqueTypes::No, formal_input_ty, coerced_ty)
563+
.sup(DefineOpaqueTypes::Yes, formal_input_ty, coerced_ty)
564564
.err()
565565
});
566566

0 commit comments

Comments
 (0)