Remove tt -> ast -> tt round trips in attrs lowering

This commit is contained in:
Lukas Wirth 2024-01-24 22:32:46 +01:00
parent f09020567e
commit e320004dad
7 changed files with 94 additions and 72 deletions

View file

@ -131,11 +131,9 @@ impl CfgDiff {
/// of both.
pub fn new(enable: Vec<CfgAtom>, disable: Vec<CfgAtom>) -> Option<CfgDiff> {
let mut occupied = FxHashSet::default();
for item in enable.iter().chain(disable.iter()) {
if !occupied.insert(item) {
// was present
return None;
}
if enable.iter().chain(disable.iter()).any(|item| occupied.insert(item)) {
// was present
return None;
}
Some(CfgDiff { enable, disable })