mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: address review
This commit is contained in:
@@ -4,7 +4,6 @@ use std::{fs, path::PathBuf};
|
||||
pub mod codegen;
|
||||
mod flags;
|
||||
use codegen::grammar::ast_src::{AstNodeSrc, AstSrc, Field};
|
||||
use itertools::Itertools;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::env;
|
||||
use ungrammar::Grammar;
|
||||
|
||||
@@ -560,16 +560,12 @@ impl<'a> Translator<'a> {
|
||||
}
|
||||
|
||||
pub(crate) fn should_be_excluded(&self, item: &impl ast::HasAttrs) -> bool {
|
||||
let Some(sema) = self.semantics else {
|
||||
return false;
|
||||
};
|
||||
for attr in item.attrs() {
|
||||
if let Some((name, tokens)) = attr.as_simple_call() {
|
||||
if name == "cfg" && sema.check_cfg_attr(&tokens) == Some(false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
false
|
||||
self.semantics.is_some_and(|sema| {
|
||||
item.attrs().any(|attr| {
|
||||
attr.as_simple_call().is_some_and(|(name, tokens)| {
|
||||
name == "cfg" && sema.check_cfg_attr(&tokens) == Some(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user