Skip to content

Refactor Function::is_test_utility to examine its attributes instead of mutable state for the "test utility" flag.#4006

Draft
copybara-service[bot] wants to merge 1 commit intomainfrom
test_890001378
Draft

Refactor Function::is_test_utility to examine its attributes instead of mutable state for the "test utility" flag.#4006
copybara-service[bot] wants to merge 1 commit intomainfrom
test_890001378

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service bot commented Mar 26, 2026

Refactor Function::is_test_utility to examine its attributes instead of mutable state for the "test utility" flag.

This removes the is_test_utility_ mutable field and set_test_utility() from the Function AST node.
Instead, Function::is_test_utility() is evaluated dynamically by querying the node's attributes.

The parser also now copies the #[cfg(test)] attribute from a proc down to its component functions to preserve AST-based test utility identification without relying on mutable state.

…d of mutable state for the "test utility" flag.

This removes the `is_test_utility_` mutable field and `set_test_utility()` from the `Function` AST node.
Instead, `Function::is_test_utility()` is evaluated dynamically by querying the node's attributes.

The parser also now copies the `#[cfg(test)]` attribute from a `proc` down to its component functions to preserve AST-based test utility identification without relying on mutable state.

PiperOrigin-RevId: 890001378
@copybara-service copybara-service bot changed the title Refactor Function::is_test_utility to use attributes instead of mutable state Refactor Function::is_test_utility to examine its attributes instead of mutable state for the "test utility" flag. Mar 27, 2026
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.

1 participant