compiler_cli_args/lib.rs
1use proc_macro::TokenStream;
2use quote::quote;
3
4/// Expands into an array of `&'static str` which contains the CLI arguments that were used when
5/// invoking `rustc`
6#[proc_macro]
7pub fn compiler_cli_args(_item: TokenStream) -> TokenStream {
8 let args: Vec<String> = std::env::args().collect();
9 quote! {
10 [#(#args),*]
11 }.into()
12}