Skip to content

Regression in 1.26: lower range bound must be less than or equal to upper #49940

@pietroalbini

Description

@pietroalbini
Member

The previous version of the chrono-humanize crate fails to compile with the lower range bound must be less than or equal to upper error (see the build log). No error nor warning was present in the 1.25 release.

error[E0030]: lower range bound must be less than or equal to upper
   --> src/humantime.rs:88:13
    |
 88 |             MIN...-1 => Tense::Past,
    |             ^^^ lower bound larger than upper bound

Since MIN is actually std::i64::MIN, the error is wrong and should be fixed.

Activity

added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
C-bugCategory: This is a bug.
on Apr 13, 2018
added this to the 1.26 milestone on Apr 13, 2018
Mark-Simulacrum

Mark-Simulacrum commented on Apr 13, 2018

@Mark-Simulacrum
Member

cc @oli-obk -- initial git log dive notes that this could be related to miri transition? Not sure.

oli-obk

oli-obk commented on Apr 13, 2018

@oli-obk
Contributor

Jup it's a regression. Minimal repro:

    const MIN: i8 = -5;
    match 5i8 {
        MIN...-1 => {},
        _ => {},
    }
added
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
on Apr 13, 2018
self-assigned this
on Apr 13, 2018
pietroalbini

pietroalbini commented on Apr 19, 2018

@pietroalbini
MemberAuthor

Not yet fixed on beta, this needs a backport.

pietroalbini

pietroalbini commented on Apr 20, 2018

@pietroalbini
MemberAuthor

Backported to beta! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.T-compilerRelevant to the compiler 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

Relationships

None yet

    Development

    Participants

    @oli-obk@pietroalbini@Mark-Simulacrum

    Issue actions

      Regression in 1.26: lower range bound must be less than or equal to upper · Issue #49940 · rust-lang/rust