about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/util.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-12 23:18:53 +0100
committerGitHub <noreply@github.com>2024-02-12 23:18:53 +0100
commit15896bdd18dc0c5c450527d526427b637671caa7 (patch)
tree793e03e547bd5abfa9f76df25825d93a87ccf48d /compiler/rustc_const_eval/src/interpret/util.rs
parent82fda11cc7d8745d6dd438df6f1ba2da9b50de90 (diff)
parent87816378ab4190583df1b74bcfeacb8bc5dd4d70 (diff)
downloadrust-15896bdd18dc0c5c450527d526427b637671caa7.tar.gz
rust-15896bdd18dc0c5c450527d526427b637671caa7.zip
Rollup merge of #120950 - compiler-errors:miri-async-closurs, r=RalfJung,oli-obk
Fix async closures in CTFE

First commit renames `is_coroutine_or_closure` into `is_closure_like`, because `is_coroutine_or_closure_or_coroutine_closure` seems confusing and long.

Second commit fixes some forgotten cases where we want to handle `TyKind::CoroutineClosure` the same as closures and coroutines.

The test exercises the change to `ValidityVisitor::aggregate_field_path_elem` which is the source of #120946, but not the change to `UsedParamsNeedSubstVisitor`, though I feel like it's not that big of a deal. Let me know if you'd like for me to look into constructing a test for the latter, though I have no idea what it'd look like (we can't assert against `TooGeneric` anywhere?).

Fixes #120946

r? oli-obk cc ``@RalfJung``
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/util.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/util.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs
index 416443f5f4d..52b79203d2b 100644
--- a/compiler/rustc_const_eval/src/interpret/util.rs
+++ b/compiler/rustc_const_eval/src/interpret/util.rs
@@ -34,6 +34,7 @@ where
             match *ty.kind() {
                 ty::Param(_) => ControlFlow::Break(FoundParam),
                 ty::Closure(def_id, args)
+                | ty::CoroutineClosure(def_id, args, ..)
                 | ty::Coroutine(def_id, args, ..)
                 | ty::FnDef(def_id, args) => {
                     let instance = ty::InstanceDef::Item(def_id);