Skip to content

Warn or Error on errors in constants? #49791

Closed
@oli-obk

Description

@oli-obk

Before the miri merger, you were allowed to write pub const FOO: usize = 0 - 1; (producing just a warning), but using it either in this crate or another produced an error.

Since the miri merger, these kinds of constants have become hard errors (just like within statics).

This is of course a breaking change. So we need to decide whether to move back to the warning, or break this now. The warnings have existed for a very long time, but were never moved to deny-by-default

cc @rust-lang/lang

related: #47054

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions