Skip to content

alacritty/vte fails to build on rustc master (mutable references are not allowed in constant functions) #79152

Closed

Description

Upstream ticket: alacritty/vte#68

Code

https://github.com/alacritty/vte/
I tried this code:

<code>

I expected to see this happen: explanation
The code compiles on

   stable-x86_64-unknown-linux-gnu unchanged - rustc 1.47.0 (18bf6b4f0 2020-10-07)
     beta-x86_64-unknown-linux-gnu unchanged - rustc 1.48.0-beta.10 (8236dc07b 2020-11-15)
  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.50.0-nightly (f5230fbf7 2020-11-16)

but fails to build on rustc master rustc 1.50.0-nightly (c919f490b 2020-11-17)
which I assumes makes this a regression:

    Checking vte v0.9.0 (/tmp/vte)
error[E0658]: mutable references are not allowed in constant functions
   --> src/table.rs:9:1
    |
9   | / generate_state_changes!(state_changes, {
10  | |     Anywhere {
11  | |         0x18 => (Ground, Execute),
12  | |         0x1a => (Ground, Execute),
...   |
170 | |     }
171 | | });
    | |___^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
   --> src/table.rs:9:1
    |
9   | / generate_state_changes!(state_changes, {
10  | |     Anywhere {
11  | |         0x18 => (Ground, Execute),
12  | |         0x1a => (Ground, Execute),
...   |
170 | |     }
171 | | });
    | |___^
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

Version it worked on

It most recently worked on:

Version with regression

rustc --version --verbose:

<version>

Backtrace

Backtrace

<backtrace>

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

Metadata

Assignees

No one assigned

    Labels

    A-const-fnArea: const fn foo(..) {..}. Pure functions which can be applied at compile time.C-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleP-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions