Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generator: Use "Backwards-compatible" comment to detect and omit deprecated aliases #502

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

MarijnS95
Copy link
Collaborator

@MarijnS95 MarijnS95 commented Nov 23, 2021

vk.xml now contains the comment text "Backwards-compatible alias containing a typo" which we can use to detect intentional renames, without needing to specify explicit overrides/exceptions in the generator anymore.

These deprecated constants exist for the sole reason of backwards compatibility which Vulkan cannot permit itself to remove in the C headers, but are unreasonable for crate authors to use anyway due to their #[deprecated] annotation whose cargo-check warnings are easy to fix by just using the non-deprecated variant instead. Furthermore, Ash is still allowing itself to perform breaking changes in its releases making this the perfect time to get rid of all these useless variants and the generator support code that comes with it. No need to come up with a "more proper" variant name if we don't generate those that "intentionally" fail to adhere to the "enum variant name" specification in the first place.


Perhaps we should reach a point where we just stop generating any variants with this discrepancy at all, given that we're releasing ash where breaking changes are allowed and #[deprecated] triggers check/clippy warnings already anyway. I doubt anyone uses these (EDIT: Bar all the missing #[deprecated] annotations from https://github.com/MaikKlein/ash/pull/501/files... 😅). Done!

@MarijnS95 MarijnS95 requested a review from Ralith November 23, 2021 19:28
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Dropping the backwards-compatibility aliases entirely sounds good to me.

ash/src/vk/extensions.rs Outdated Show resolved Hide resolved
@MarijnS95
Copy link
Collaborator Author

MarijnS95 commented Nov 23, 2021

Dropping the backwards-compatibility aliases entirely sounds good to me.

They also don't make much sense anyway with just the VK_ prefix stripped from them. Shall we do that as part of this PR immediately already?

@Ralith
Copy link
Collaborator

Ralith commented Nov 23, 2021

If you're up for it, I see no reason to delay!

generator/src/lib.rs Outdated Show resolved Hide resolved
vk.xml now contains the comment text "Backwards-compatible alias
containing a typo" which we can use to detect intentional renames,
without needing to specify explicit overrides/exceptions in the
generator anymore.

These deprecated constants exist for the sole reason of backwards
compatibility which Vulkan cannot permit itself to remove in the C
headers, but are unreasonable for crate authors to use anyway due to
their `#[deprecated]` annotation whose cargo-check warnings are easy to
fix by just using the non-deprecated variant instead.  Furthermore, Ash
is still allowing itself to perform breaking changes in its releases
making this the perfect time to get rid of all these useless variants
and the generator support code that comes with it.  No need to come up
with a "more proper" variant name if we don't generate those that
"intentionally" fail to adhere to the "enum variant name" specification
in the first place.
@MarijnS95 MarijnS95 force-pushed the typo-from-backcompat-comment branch from 5cf2200 to fca8109 Compare November 25, 2021 09:45
@MarijnS95 MarijnS95 requested a review from Ralith November 25, 2021 09:47
@MarijnS95
Copy link
Collaborator Author

@Ralith Done!

Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Very tidy!

@Ralith Ralith merged commit 4424efe into master Nov 26, 2021
@Ralith Ralith deleted the typo-from-backcompat-comment branch November 26, 2021 19:13
@MarijnS95 MarijnS95 changed the title generator: Use "Backwards-compatible" comment to detect deprecated alias generator: Use "Backwards-compatible" comment to detect and omit deprecated aliases Jan 8, 2022
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