2023-04-20 09:37:15 -05:00
|
|
|
//@compile-flags: --emit=link
|
|
|
|
//@no-prefer-dynamic
|
2021-07-04 06:06:23 -05:00
|
|
|
|
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
|
|
|
|
|
|
|
use proc_macro::TokenStream;
|
|
|
|
|
|
|
|
#[proc_macro_derive(DeriveSomething)]
|
|
|
|
pub fn derive(_: TokenStream) -> TokenStream {
|
|
|
|
"fn _f() -> Vec<u8> { vec![] }".parse().unwrap()
|
|
|
|
}
|
|
|
|
|
|
|
|
#[proc_macro]
|
|
|
|
pub fn foo_bar(_: TokenStream) -> TokenStream {
|
|
|
|
"fn issue_7422() { eprintln!(); }".parse().unwrap()
|
|
|
|
}
|