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

Support referring to Self in bitflags constants #570

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Support referring to Self in bitflags constants #570

merged 1 commit into from
Sep 8, 2021

Conversation

jonas-schievink
Copy link
Contributor

The initial bitflags support in #528 had a restriction where referring to the Self type in a bitflags constant would result in a compile error.

Turns out that's entirely unnecessary and I wasn't quite awake when I wrote that code. A minor modification of the generated code avoids this somewhat annoying restriction. Instead of copying the expression verbatim, we can just refer to the associated constant created by the bitflags crate, and extract the raw bits.

Copy link
Member

@Urhengulas Urhengulas left a comment

Choose a reason for hiding this comment

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

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 8, 2021

Build succeeded:

@bors bors bot merged commit 046b16d into knurling-rs:main Sep 8, 2021
@jonas-schievink jonas-schievink deleted the selfish-bitflags branch September 8, 2021 09:55
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.

2 participants