mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Remove tt -> ast -> tt round trips in attrs lowering
This commit is contained in:
parent
f09020567e
commit
e320004dad
7 changed files with 94 additions and 72 deletions
|
@ -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 })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue