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

ambiguous associated item 'Error' since 0.23 #4723

Open
brmmm3 opened this issue Nov 21, 2024 · 1 comment · May be fixed by #4725
Open

ambiguous associated item 'Error' since 0.23 #4723

brmmm3 opened this issue Nov 21, 2024 · 1 comment · May be fixed by #4725
Assignees
Labels

Comments

@brmmm3
Copy link

brmmm3 commented Nov 21, 2024

Bug Description

Since 0.23 I get the following error message when I define an enum which contains the name 'Error':

ambiguous associated item
this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
for more information, see issue #57644 <https://github.com/rust-lang/rust/issues/57644>
`#[deny(ambiguous_associated_items)]` on by default

The enum is defined as follows:

#[pyclass(eq, eq_int)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Level2Sym {
    NotSet = 0,
    Debug = 10,
    Info = 20,
    Warning = 30,
    Error = 40,
    Critical = 50,
    Exception = 60,
    NoLog = 100,
}

Steps to Reproduce

Just changed the version from 0.22 to 0.23 and this error message is shown.

Backtrace

No response

Your operating system and version

Ubuntu 24.04.1 LTS

Your Python version (python --version)

Python 3.12.7

Your Rust version (rustc --version)

rustc 1.84.0-nightly (5ec7d6eee 2024-11-17)

Your PyO3 version

0.23.1

How did you install python? Did you use a virtualenv?

pyenv

Additional Info

No response

@brmmm3 brmmm3 added the bug label Nov 21, 2024
@LilyFoote
Copy link
Contributor

LilyFoote commented Nov 21, 2024

I can replicate this and I've bisected it to 0a185cd. I can confirm that any of the associated types Error, Output and Target for the IntoPyObject trait lead to this error.

@LilyFoote LilyFoote self-assigned this Nov 21, 2024
LilyFoote added a commit that referenced this issue Nov 21, 2024
@LilyFoote LilyFoote linked a pull request Nov 21, 2024 that will close this issue
LilyFoote added a commit that referenced this issue Nov 22, 2024
LilyFoote added a commit that referenced this issue Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants