Skip to content

Improve E0391 #60178

Closed
Closed
@estebank

Description

@estebank

In #60126 we continue compiling on what used to be a hard error, causing both E0072 (recursive type) and E0391 (cycle detected when processing). In this case in particular, the later error shouldn't be emitted if it is already explained by another error. At the same time, the current output is less than ideal and could be improved:

error[E0391]: cycle detected when processing `MList`
  --> $DIR/infinite-tag-type-recursion.rs:1:1
   |
LL | enum MList { Cons(isize, MList), Nil }
   | ^^^^^^^^^^
   |
   = note: ...which again requires processing `MList`, completing the cycle
   = note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, def_id: None }, value: MList } }`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions