rustc-ap-syntax 645.0.0

Automatically published version of the package `syntax` in the rust-lang/rust repository from commit 834bc5650acf7019a53b409db68986857822812c The publishing script for this crate lives at: https://github.com/alexcrichton/rustc-auto-publish
1
2
3
4
5
6
7
8
9
10
11
12
//! Definitions shared by macros / syntax extensions and e.g. librustc.

use crate::ast::Attribute;
use rustc_span::symbol::sym;

pub mod allocator;

pub fn is_proc_macro_attr(attr: &Attribute) -> bool {
    [sym::proc_macro, sym::proc_macro_attribute, sym::proc_macro_derive]
        .iter()
        .any(|kind| attr.check_name(*kind))
}