Skip to content

Cleanup CTFE error reporting code & centralize promoted error reporting logic #75461

Closed
@RalfJung

Description

@RalfJung

CTFE error reporting code is quite complex, and some of the logic is repeated in many places -- e.g. the fact that we do not report hard errors for evaluation failures in promoteds. We should try to centralize that logic (and with rust-lang/const-eval#53 we can hopefully get rid of some of it eventually).

Cases I know of:

  • This here might or might not still be needed but at least the "promoteds only get lints" logic" can hopefully be deduplicated and all the error-reporting logic also moved to librustc_mir::const_eval.
  • Codegen also does CTFE error reporting (with yet another copy of the "promoted" logic) that should be handled through librustc_mir::const_eval::error.

Cc @rust-lang/wg-const-eval

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions