bitflags v2.2 incompatibility with mysql_common #343
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#343
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?
Originally posted on mysql_common repo (https://github.com/blackbeam/rust_mysql_common/issues/87), but the maintainer there seems to think this is an issue with bitflags, so just letting you know. I don't know whether this is a bug on bitflags itself or on how mysql_common uses it, but at the very least might be a compatibility break on 2.2.
Trying to compile the last version of the mysql_common crate with bitflags 2.2 gives a compilation error.
Minimal example:
Cargo.toml
main.rs
Compilation output:
"Pinning" bitflags to 2.1 fixes the compilation error.
"Fixed" Cargo.toml
Hi @glueball 👋
That looks like a bug in
bitflagsso I'll take a look 👀 That__declare_bitflagsmacro is new so it might have a recursion bug in it somewhere.I've yanked
2.2.0until we know what's going on to avoid too many spurious reports of the same issue in upstream repositories.This is caused by #341
It's not infinitely recursing, just doing a lot more recursion than before. That code was introduced to work around an issue with some attributes like
#[doc(alias)]not being allowed on expressions. We use a tt-muncher to sift through those attributes and only apply#[cfg]s to expressions internally that refer to flags.I think we've got a few ways forward:
#[recursion_limit]if they run into it. I don't think that's really tenable because it's likely pretty widespread.I think option 2 is probably the best.