rustc_attr_parsing/attributes/body.rs
1//! Attributes that can be found in function body.
2
3use super::prelude::*;
4
5pub(crate) struct CoroutineParser;
6
7impl<S: Stage> NoArgsAttributeParser<S> for CoroutineParser {
8 const PATH: &[Symbol] = &[sym::coroutine];
9 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
10 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Closure)]);
11 const CREATE: fn(rustc_span::Span) -> AttributeKind = |span| AttributeKind::Coroutine(span);
12}