Constants cannot be cfg-gated multiple times #137
Labels
No labels
bug
good first issue
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-bitflags/bitflags#137
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why not? This seems to work just fine:
@sfackler Thanks for the answer, I just realised I misformulated this issue.
This doesn't work:
I've worked around it doing this:
Weird!
It looks like the problem here is our logic that attempts to handle flags that have been cfg'd out. We intentionally omit attributes from flags to ensure they're known to the debug format and the
allfunction. Unfortunately this doesn't handle flags where the same flag is defined with different values based on cfg. I haven't quite unpicked why we need the names of all flags to be available, but I think the way we currently do it might just be plain broken given a flag isn't just either present or not, it may have a totally different value.It looks like it might actually be a bit of an artefact from pre-associated-const days (how far we’ve come). It might be possible to simplify these now and either avoid the need for those traits or just apply the cfgs to them.