rust/tests/ui/proc-macro/auxiliary/issue-91800-macro.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
554 B
Rust
Raw Normal View History

// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::TokenStream;
fn compile_error() -> TokenStream {
r#"compile_error!("")"#.parse().unwrap()
}
#[proc_macro_derive(MyTrait)]
pub fn derive(input: TokenStream) -> TokenStream {
compile_error()
}
#[proc_macro_attribute]
pub fn attribute_macro(_attr: TokenStream, mut input: TokenStream) -> TokenStream {
input.extend(compile_error());
input
}
#[proc_macro]
pub fn fn_macro(_item: TokenStream) -> TokenStream {
compile_error()
}