Skip to content

Conversation

msierks-pcln
Copy link
Contributor

@msierks-pcln msierks-pcln commented Sep 11, 2025

If a field is marked as deprecated, the setter and accessor methods should be as well.

Fixes: #985

Copy link
Contributor

@caspermeijn caspermeijn left a comment

Choose a reason for hiding this comment

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

I recently merged #1316. Please rebase and verify this is still needed.

Please add some test that proves the deprecated attribute is actually added to the correct functions.

attrs: &[Meta],
inferred_tag: Option<u32>,
deprecated: bool,
) -> Result<Option<Field>, Error> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function can itself determine the deprecated state from attrs. It makes sense to do that in the for attr in attrs loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case all non-prost attributes are filtered out by prost_attrs() before they are passed to this method. Which is why I check for the deprecated attribute before. I suppose we could adjust prost_attrs() to pass it through, though I'm not sure what other affects that might have.

What are your thoughts?

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.

#[deprecated] decorator is missing on enum access functions
2 participants