Skip to content

Some compile errors within const block of associated constants are not evaluated #71403

Closed
@DoumanAsh

Description

@DoumanAsh

Basically, if you put potential error into const block of associated constant, it doesn't gets evaluated.
Good example is arithmetic_overflow.
By default it triggers compilation error, but not when it is within const block of associated constant

Rust playgound sample:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6ae8ce6871821d8fce58cc05dbdd5984

Doubt it is expected behavior?

Instead, this happened: explanation

Happens in both latest stable and nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    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