mbe: Change unused_macro_rules to a DenseBitSet

Now that it only contains indexes, and no other information, a bitset
provides a more compact and simpler representation.
This commit is contained in:
Josh Triplett
2025-07-04 14:00:32 -07:00
parent 3c95364c4a
commit 8ee1e9817c
5 changed files with 9 additions and 6 deletions

View File

@@ -334,7 +334,7 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
fn record_macro_rule_usage(&mut self, id: NodeId, rule_i: usize) {
if let Some(rules) = self.unused_macro_rules.get_mut(&id) {
rules.remove(&rule_i);
rules.remove(rule_i);
}
}
@@ -359,7 +359,7 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
let SyntaxExtensionKind::LegacyBang(ref ext) = m.ext.kind else {
continue;
};
for &arm_i in unused_arms.to_sorted_stable_ord() {
for arm_i in unused_arms.iter() {
if let Some((ident, rule_span)) = ext.get_unused_rule(arm_i) {
self.lint_buffer.buffer_lint(
UNUSED_MACRO_RULES,