about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-14 16:33:25 -0400
committerMichael Goulet <michael@errs.io>2024-09-14 16:33:25 -0400
commit63405fc2b3a15194e47712b738275c6d76de6b27 (patch)
tree60cb1e6bd409feb8a2e3745b185b113a41cbdfba /compiler/rustc_middle/src
parent5fe0e40e05f2d0408c6a292b160f96d595aedfbc (diff)
downloadrust-63405fc2b3a15194e47712b738275c6d76de6b27.tar.gz
rust-63405fc2b3a15194e47712b738275c6d76de6b27.zip
Consider synthetic closure bodies to be typeck children
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/util.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs
index d70ff8258d0..a0262f12cb5 100644
--- a/compiler/rustc_middle/src/ty/util.rs
+++ b/compiler/rustc_middle/src/ty/util.rs
@@ -571,7 +571,10 @@ impl<'tcx> TyCtxt<'tcx> {
     /// Returns `true` if `def_id` refers to a definition that does not have its own
     /// type-checking context, i.e. closure, coroutine or inline const.
     pub fn is_typeck_child(self, def_id: DefId) -> bool {
-        matches!(self.def_kind(def_id), DefKind::Closure | DefKind::InlineConst)
+        matches!(
+            self.def_kind(def_id),
+            DefKind::Closure | DefKind::InlineConst | DefKind::SyntheticCoroutineBody
+        )
     }
 
     /// Returns `true` if `def_id` refers to a trait (i.e., `trait Foo { ... }`).