about summary refs log tree commit diff
path: root/compiler/rustc_hir
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-11-08 06:56:06 +0000
committerMichael Goulet <michael@errs.io>2024-01-08 20:30:21 +0000
commit82a22154815b70e5701064bef59d3334f5bc1cf7 (patch)
tree40d6223ac17b8293ea29e1b2266817f56c56d75c /compiler/rustc_hir
parentdfb9f5df2c9f3c60f2541b3804cb6be1b5c66e63 (diff)
downloadrust-82a22154815b70e5701064bef59d3334f5bc1cf7.tar.gz
rust-82a22154815b70e5701064bef59d3334f5bc1cf7.zip
Don't check for recursion in generator witness fields
Diffstat (limited to 'compiler/rustc_hir')
-rw-r--r--compiler/rustc_hir/src/hir.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index e88b876534e..cadf54c76a3 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -1361,6 +1361,12 @@ impl CoroutineKind {
     }
 }
 
+impl CoroutineKind {
+    pub fn is_fn_like(self) -> bool {
+        matches!(self, CoroutineKind::Desugared(_, CoroutineSource::Fn))
+    }
+}
+
 impl fmt::Display for CoroutineKind {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {