Skip to content

ICE: suggestion must not have overlapping parts E0599 #130395

@matthiaskrgr

Description

@matthiaskrgr

Code

enum U {
    B(isize, usize),
}

fn main() {
    let x = T::A(U::C);
}

Meta

rustc --version --verbose:

rustc 1.83.0-nightly (9b72238eb 2024-09-14)
binary: rustc
commit-hash: 9b72238eb813e9d06e9e9d270168512fbffd7ee7
commit-date: 2024-09-14
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Error output

error[E0433]: failed to resolve: use of undeclared type `T`
 --> k.rs:6:13
  |
6 |     let x = T::A(U::C);
  |             ^
  |             |
  |             use of undeclared type `T`
  |             help: an enum with a similar name exists: `U`

error[E0599]: no variant or associated item named `C` found for enum `U` in the current scope
 --> k.rs:6:21
  |
1 | enum U {
  | ------ variant or associated item `C` not found for this enum
...
6 |     let x = T::A(U::C);
  |                     ^ variant or associated item not found in `U`
  |
help: there is a variant with a similar name
  |
6 |     let x = T::A(/* isize */, /* usize */B);
  |                  ~~~~~~~~~~~~~~~~~~~~~~~~

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions