fix: Enum variant named Error causes ambiguous item#1098
Merged
LucioFranco merged 1 commit intotokio-rs:masterfrom Jul 9, 2024
Merged
fix: Enum variant named Error causes ambiguous item#1098LucioFranco merged 1 commit intotokio-rs:masterfrom
Error causes ambiguous item#1098LucioFranco merged 1 commit intotokio-rs:masterfrom
Conversation
The generated code uses `Self::Error` to refer to `::prost::UnknownEnumValue`, but the term `Error` is not unique when an enum variant is called `Error`. Use the full type name to resolve the ambiguity.
The compiler reported:
```
error: ambiguous associated item
--> /home/ircdev/src/prost/target/debug/build/tests-no-std-e27db7197924752f/out/enum_keyword_variant.rs:2:68
|
2 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
| ^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57644 <rust-lang/rust#57644>
note: `Error` could refer to the variant defined here
--> /home/ircdev/src/prost/target/debug/build/tests-no-std-e27db7197924752f/out/enum_keyword_variant.rs:10:5
|
10 | Error = 4,
| ^^^^^
note: `Error` could also refer to the associated type defined here
--> /home/ircdev/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:682:5
|
682 | type Error;
| ^^^^^^^^^^
= note: `#[deny(ambiguous_associated_items)]` on by default
= note: this error originates in the derive macro `::prost::Enumeration` (in Nightly builds, run with -Z macro-backtrace for more info)
```
Contributor
Author
|
CIFuzz is failing due to a problem not related to this change: google/oss-fuzz#12168 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The generated code uses
Self::Errorto refer to::prost::UnknownEnumValue, but the termErroris not unique when an enum variant is calledError. Use the full type name to resolve the ambiguity.The compiler reported:
Fixes #1097