about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-02-21 15:36:49 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-04 15:43:14 +0000
commitede0556ab538ccaa928299812519db95aff9d7ca (patch)
treea505d32576dd13180fb14e18724936c5417debc0
parent0183d92df0591b25363b3e12ae0a4a8f1b0b076c (diff)
downloadrust-ede0556ab538ccaa928299812519db95aff9d7ca.tar.gz
rust-ede0556ab538ccaa928299812519db95aff9d7ca.zip
Effects are boolean consts and don't contain opaque types
-rw-r--r--compiler/rustc_hir_typeck/src/callee.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs
index 0e75a47683d..aa94632b2b0 100644
--- a/compiler/rustc_hir_typeck/src/callee.rs
+++ b/compiler/rustc_hir_typeck/src/callee.rs
@@ -918,7 +918,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
         let param = callee_args.const_at(host_effect_index);
         let cause = self.misc(span);
-        match self.at(&cause, self.param_env).eq(infer::DefineOpaqueTypes::No, effect, param) {
+        // We know the type of `effect` to be `bool`, there will be no opaque type inference.
+        match self.at(&cause, self.param_env).eq(infer::DefineOpaqueTypes::Yes, effect, param) {
             Ok(infer::InferOk { obligations, value: () }) => {
                 self.register_predicates(obligations);
             }