Skip to content

Broken on latest nightlies (regression on 2020-06-04) #1

@mx00s

Description

@mx00s

Bumping the rust version in rust-toolchain by one day causes the crate to fail with compile-time errors like this:

error: constant expression depends on a generic parameter
 --> src/ranged_i32/add/ranged_i32.rs:9:5
  |
9 |     type Output = RangedI32<{ START + START_RHS }, { END + END_RHS }>;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this may fail depending on what value the parameter takes

This reproduces with the recent nightly-2020-12-15 release as well.

What changed?

Here are the rustc git revisions associated with 2020-06-03 and 2020-06-04 nightly releases:

$ rustup run nightly-2020-06-03 rustc --version
rustc 1.45.0-nightly (fe10f1a49 2020-06-02)
$ rustup run nightly-2020-06-04 rustc --version
rustc 1.45.0-nightly (56daaf669 2020-06-03)

Here's what changed over that range of commits: rust-lang/rust@fe10f1a...56daaf6.

The following stick out to me, although I haven't yet traced any concrete connection between any particular change and the regression here. Some test files include similar error messages with strings like constant expression depends on a generic parameter and this may fail depending on what value the parameter takes, but the text must have already existed in the compiler's source:

Both come from the rust-lang/rust#70107 PR.

Potential Solutions

  1. Find a workaround
  2. Patch rustc and convince the community to adopt it

In either case it may be insightful to further isolate exactly what change(s) caused the regression and whether undoing them on top of a 56daaf669 build fixes it. To do that I'd need to figure out how to persuade cargo/rustup to use a custom-built rustc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions