Skip to content

Consider changing the way unevaluated constants are printed #61581

Open
@oli-obk

Description

@oli-obk

cc #60742 (comment)

Right now when we encounter a ConstValue::Unevaluated during pretty printing, we fall back to printing the constant's source code or _ if that also fails. Alternative options are:

  • try to eagerly evaluate (and fall back to one of the following)
  • always print _
  • print something like {{unevaluated: {}}} where {} is the source code
  • print just {unevaluated} (seems useless for users, so maybe not a good idea)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-const-genericsArea: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-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