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

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

Closed
matthiaskrgr opened this issue Nov 17, 2020 · 9 comments

Comments

@matthiaskrgr
Copy link

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
Copy link
Member

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

@matthiaskrgr
Copy link
Author

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

@matthiaskrgr
Copy link
Author

There's a new soundness fix but it does not look related in my eyes rust-lang/rust#79048

@matthiaskrgr
Copy link
Author

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

@kchibisov
Copy link
Member

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

@vinc
Copy link

vinc commented Nov 25, 2020

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
Copy link
Member

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
Copy link

vinc commented Nov 25, 2020

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
Copy link
Author

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

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

No branches or pull requests

4 participants