tamer: parse::parser::Parser::feed_tok: cfg note precedence

Rust was warning that `cfg` was unused if both `test` and
`parser-trace-stderr`.  This both allows that and adjusts the precedence to
make more sense for tests.

DEV-7145
main
Mike Gerwitz 2022-07-21 22:40:41 -04:00
parent c3dfcc565c
commit 4b5e51b0f0
1 changed files with 3 additions and 2 deletions

View File

@ -325,10 +325,11 @@ impl<S: ParseState, I: TokenStream<S::Token>> Parser<S, I> {
);
}
#[cfg(test)]
let cfg = "test";
#[cfg(feature = "parser-trace-stderr")]
#[allow(unused_variables)]
let cfg = "feature = \"parser-trace-stderr\"";
#[cfg(test)] // takes precedence if both are set
let cfg = "test";
eprint!(
"note: this trace was output as a debugging aid \
because `cfg({cfg})`.\n\n",