Skip to content

Conversation

@ANtutov
Copy link
Contributor

@ANtutov ANtutov commented Feb 9, 2026

Summary

Removed the redundant collect_extra_allowed_attributes call from validate_attributes_flat and use the passed extra_allowed_attributes parameter directly. This eliminates duplicate work while maintaining the same validation behavior.


Type of change

  • Style, wording, formatting, or typo-only change

Why is this change needed?

The validate_attributes_flat function redundantly called collect_extra_allowed_attributes internally, even though the caller validate_attributes already collected these attributes and passed them as the extra_allowed_attributes parameter. This caused:

  1. Double work for top-level items - attributes were collected twice
  2. Unnecessary calls for nested items (trait functions, struct fields, enum variants) which cannot have #[allow(...)] attributes anyway

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orizi made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ANtutov).


a discussion (no related file):
The PR assumes nested items can't have #[allow_attr(...)], but removing the local collection prevents nested items from defining their own allowed attributes. This could be a breaking change if any nested items use #[allow_attr(...)].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants