Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/test-fixture/src/lib.rs')
-rw-r--r--crates/test-fixture/src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/test-fixture/src/lib.rs b/crates/test-fixture/src/lib.rs
index 8937e53175..4413d2f222 100644
--- a/crates/test-fixture/src/lib.rs
+++ b/crates/test-fixture/src/lib.rs
@@ -955,12 +955,12 @@ impl ProcMacroExpander for DisallowCfgProcMacroExpander {
_: String,
) -> Result<TopSubtree, ProcMacroExpansionError> {
for tt in subtree.token_trees().flat_tokens() {
- if let tt::TokenTree::Leaf(tt::Leaf::Ident(ident)) = tt {
- if ident.sym == sym::cfg || ident.sym == sym::cfg_attr {
- return Err(ProcMacroExpansionError::Panic(
- "cfg or cfg_attr found in DisallowCfgProcMacroExpander".to_owned(),
- ));
- }
+ if let tt::TokenTree::Leaf(tt::Leaf::Ident(ident)) = tt
+ && (ident.sym == sym::cfg || ident.sym == sym::cfg_attr)
+ {
+ return Err(ProcMacroExpansionError::Panic(
+ "cfg or cfg_attr found in DisallowCfgProcMacroExpander".to_owned(),
+ ));
}
}
Ok(subtree.clone())