about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/attributes/body.rs
blob: a1492d7619461679ba3251cf9c628acb00488a32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//! Attributes that can be found in function body.

use super::prelude::*;

pub(crate) struct CoroutineParser;

impl<S: Stage> NoArgsAttributeParser<S> for CoroutineParser {
    const PATH: &[Symbol] = &[sym::coroutine];
    const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
    const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Closure)]);
    const CREATE: fn(rustc_span::Span) -> AttributeKind = |span| AttributeKind::Coroutine(span);
}