Skip to content

Support referring to Self in bitflags constants#570

Merged
bors[bot] merged 1 commit intoknurling-rs:mainfrom
jonas-schievink:selfish-bitflags
Sep 8, 2021
Merged

Support referring to Self in bitflags constants#570
bors[bot] merged 1 commit intoknurling-rs:mainfrom
jonas-schievink:selfish-bitflags

Conversation

@jonas-schievink
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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