alacritty / vte

Parser for virtual terminal emulators
https://docs.rs/vte/
Apache License 2.0
242 stars 56 forks source link

build failure with nightly (mutable references are not allowed in constant functions) #68

Closed matthiaskrgr closed 3 years ago

matthiaskrgr commented 3 years ago

Trying to build with rustc 1.50.0-nightly (c919f490b 2020-11-17), I get the following error:

    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

Some errors have detailed explanations: E0015, E0658.
For more information about an error, try `rustc --explain E0015`.
error: could not compile `vte`

To learn more, run the command again with --verbose.

This also breaks the alacritty-git build for me.

kchibisov commented 3 years ago

Does it work with stable? if so bring it to rust?

matthiaskrgr commented 3 years ago

Ah, this works on nightly, beta and stable but not on master (so next nightly will break it).

matthiaskrgr commented 3 years ago

There's a new soundness fix but it does not look related in my eyes https://github.com/rust-lang/rust/issues/79048

matthiaskrgr commented 3 years ago

The 0.6.0 release fails to compile on nightly because of this.

kchibisov commented 3 years ago

Well, we can't do anything, don't use nightly.

vinc commented 3 years ago

I'm developing a toy OS (https://github.com/vinc/moros) that uses vte and the OS needs nightly so personally I'm a bit stuck with this issue, but it's not a big deal and I'll wait until it's fixed on rust's side.

chrisduerr commented 3 years ago

I'm developing a toy OS (https://github.com/vinc/moros) that uses vte and the OS needs nightly so personally I'm a bit stuck with this issue, but it's not a big deal and I'll wait until it's fixed on rust's side.

Nothing stops you from using an earlier nightly version.

vinc commented 3 years ago

Nothing stops you from using an earlier nightly version.

True, but the CI use the latest version so the PRs are all failing. But again it's not a big deal, I was just replying to the issue to mention that there's also an interest on this crate outside of Alacritty. No worries!

matthiaskrgr commented 3 years ago

The upstream bug has been fixed, next nightly should be able to compile this crate again. :)