From b8c22496bbbefcc2e93782cac7b180a52ff7485a Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sat, 23 May 2020 22:03:33 -0500 Subject: [PATCH] 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 --- src/uucore/src/uucore_procs/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/uucore/src/uucore_procs/src/lib.rs b/src/uucore/src/uucore_procs/src/lib.rs index 38847dd55..762194b2e 100644 --- a/src/uucore/src/uucore_procs/src/lib.rs +++ b/src/uucore/src/uucore_procs/src/lib.rs @@ -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: @@ @@ -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);