Skip to content

Consteval cannot handle non-scalar identity casts #37448

Closed
@nagisa

Description

@nagisa
struct A;
&A as A;

results in

warning: can't cast this type, #[warn(const_err)] on by default
 --> <anon>:3:5
  |
3 |     A as A;
  |     ^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions