-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-imprecise-spansDiagnostics: spans don't point to exactly the erroneous codeDiagnostics: spans don't point to exactly the erroneous codeD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
enum Foo {
Foo,
}
fn foo() -> Result<(), Foo> {
Err(Foo::Fooo)
}Current output
error[E0599]: no variant or associated item named `Fooo` found for enum `Foo` in the current scope
--> src/lib.rs:6:18
|
1 | enum Foo {
| -------- variant or associated item `Fooo` not found for this enum
...
6 | Err(Foo::Fooo)
| ^^^^ variant or associated item not found in `Foo`
|
help: there is a variant with a similar name
|
6 - Err(Foo::Fooo)
6 + Err(Foo::Foo
|
For more information about this error, try `rustc --explain E0599`.Desired output
6 + Err(Foo::Foo)Rationale and extra context
No response
Other cases
Rust Version
rustc 1.92.0 (ded5c06cf 2025-12-08) (built from a source tarball)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: x86_64-unknown-openbsd
release: 1.92.0
LLVM version: 20.1.8Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-imprecise-spansDiagnostics: spans don't point to exactly the erroneous codeDiagnostics: spans don't point to exactly the erroneous codeD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.