Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pietroalbini opened this issue Apr 13, 2018 · 4 comments · Fixed by #49949
Closed

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

pietroalbini opened this issue Apr 13, 2018 · 4 comments · Fixed by #49949
Assignees
Labels
A-const-eval Area: constant evaluation (mir interpretation) C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@pietroalbini
Copy link
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.

@pietroalbini pietroalbini added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. C-bug Category: This is a bug. labels Apr 13, 2018
@pietroalbini pietroalbini added this to the 1.26 milestone Apr 13, 2018
@Mark-Simulacrum
Copy link
Member

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

@oli-obk
Copy link
Contributor

oli-obk commented Apr 13, 2018

Jup it's a regression. Minimal repro:

    const MIN: i8 = -5;
    match 5i8 {
        MIN...-1 => {},
        _ => {},
    }

@oli-obk oli-obk added the A-const-eval Area: constant evaluation (mir interpretation) label Apr 13, 2018
@oli-obk oli-obk self-assigned this Apr 13, 2018
bors added a commit that referenced this issue Apr 19, 2018
Sign extend constants in range patterns

fixes  #49940

r? @Mark-Simulacrum
@pietroalbini
Copy link
Member Author

Not yet fixed on beta, this needs a backport.

@pietroalbini pietroalbini reopened this Apr 19, 2018
@pietroalbini
Copy link
Member Author

Backported to beta! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: constant evaluation (mir interpretation) C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants