1
Fork 0

Add explicit syntax for coroutines instead of relying on closures having yield expressions

This commit is contained in:
Oli Scherer 2024-04-11 12:48:32 +00:00
parent 29a56a3b1c
commit a589632dad
3 changed files with 19 additions and 3 deletions

View file

@ -534,6 +534,12 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
EncodeCrossCrate::Yes, experimental!(cfi_encoding)
),
// `#[coroutine]` attribute to be applied to closures to make them coroutines instead
gated!(
coroutine, Normal, template!(Word), ErrorFollowing,
EncodeCrossCrate::No, coroutines, experimental!(coroutines)
),
// ==========================================================================
// Internal attributes: Stability, deprecation, and unsafe:
// ==========================================================================