mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-05 07:27:46 +00:00
change/uucore_procs ~ add work-around for attribute/macro name collision during testing
- proc_macro "main" collides with attribute "#[main]" during testing (for rust < v1.38.0; fixed in v1.38.0+) - ref: GH:rust-lang/rust#62127
This commit is contained in:
parent
e35bd4b79c
commit
b8c22496bb
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
|||
#![allow(dead_code)] // work-around for GH:rust-lang/rust#62127; maint: can be removed when MinSRV >= v1.38.0
|
||||
#![allow(unused_macros)] // work-around for GH:rust-lang/rust#62127; maint: can be removed when MinSRV >= v1.38.0
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
// spell-checker:ignore () SIGPIPE uucore uumain uutils
|
||||
// spell-checker:ignore () SIGPIPE maint uucore uumain uutils
|
||||
|
||||
//## rust proc-macro background info
|
||||
//* ref: <https://dev.to/naufraghi/procedural-macro-in-rust-101-k3f> @@ <http://archive.is/Vbr5e>
|
||||
|
@ -43,6 +46,7 @@ impl syn::parse::Parse for Tokens {
|
|||
}
|
||||
|
||||
#[proc_macro]
|
||||
#[cfg(not(test))] // work-around for GH:rust-lang/rust#62127; maint: can be removed when MinSRV >= v1.38.0
|
||||
pub fn main(stream: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||
let Tokens { expr } = syn::parse_macro_input!(stream as Tokens);
|
||||
proc_dbg!(&expr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue