mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
cargo clippy --fix
This commit is contained in:
parent
423c7dd23a
commit
8ce30264c8
186 changed files with 3056 additions and 3314 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue