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

fix duplicate definitions #461

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Conversation

NicolasBircksZR
Copy link
Contributor

Since using accesskit 0.16.2 the following issue appears when enabling the enumn feature

error[E0592]: duplicate definitions with name `n`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/accesskit-0.16.2/src/lib.rs:270:38
    |
270 | #[cfg_attr(feature = "enumn", derive(enumn::N))]
    |                                      ^^^^^^^^ duplicate definitions for `n`
...
349 |     fn n(value: u8) -> Option<Self> {
    |     ------------------------------- other definition for `n`
    |
    = note: this error originates in the derive macro `enumn::N` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0034]: multiple applicable items in scope
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/accesskit-0.16.2/src/lib.rs:386:39
    |
386 |     while let Some(variant) = Action::n(i) {
    |                                       ^ multiple `n` found
    |
note: candidate #1 is defined in an impl for the type `Action`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/accesskit-0.16.2/src/lib.rs:270:38
    |
270 | #[cfg_attr(feature = "enumn", derive(enumn::N))]
    |                                      ^^^^^^^^
note: candidate #2 is defined in an impl for the type `Action`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/accesskit-0.16.2/src/lib.rs:349:5
    |
349 |     fn n(value: u8) -> Option<Self> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the derive macro `enumn::N` (in Nightly builds, run with -Z macro-backtrace for more info)

I fixed this by not compiling the custom n() function when the enumn feature is enabled.

Fixes #460

@mwcampbell
Copy link
Contributor

@NicolasBircksZR Thanks.

@mwcampbell mwcampbell merged commit 59826d4 into AccessKit:main Oct 8, 2024
9 checks passed
@github-actions github-actions bot mentioned this pull request Oct 8, 2024
@NicolasBircksZR
Copy link
Contributor Author

@mwcampbell I would suggest to yank the 0.16.2 release what do you think?

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.

0.16.2 release broken?
2 participants