Error when compiling `stabby-abi`
segeljakt opened this issue · 2 comments
segeljakt commented
Hi, when I try to compile stabby I get this error:
library ❯ cargo c
Checking stabby-abi v4.0.2
error[E0492]: constants cannot refer to interior mutable data
--> /Users/klasseg/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stabby-abi-4.0.2/src/vtable.rs:58:44
|
58 | const VTABLE: &'a VTable<Head, Tail> = &VTable {
| ____________________________________________^
59 | | head: *Head::VTABLE,
60 | | tail: *Tail::VTABLE,
61 | | };
| |_____^ this borrow of an interior mutable value may end up in the final value
error[E0492]: constants cannot refer to interior mutable data
--> /Users/klasseg/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stabby-abi-4.0.2/src/vtable.rs:161:36
|
161 | const VTABLE: &'a VtSend<Vt> = &VtSend(*Vt::VTABLE);
| ^^^^^^^^^^^^^^^^^^^^ this borrow of an interior mutable value may end up in the final value
error[E0492]: constants cannot refer to interior mutable data
--> /Users/klasseg/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stabby-abi-4.0.2/src/vtable.rs:172:36
|
172 | const VTABLE: &'a VtSync<Vt> = &VtSync(*Vt::VTABLE);
| ^^^^^^^^^^^^^^^^^^^^ this borrow of an interior mutable value may end up in the final value
For more information about this error, try `rustc --explain E0492`.
error: could not compile `stabby-abi` (lib) due to 3 previous errors
This is my Cargo.toml
:
# Cargo.toml
[workspace]
[package]
name = "library"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "staticlib"]
[dependencies]
stabby = "4.0.2"
My src/lib.rs
is empty. I am on stable-aarch64-apple-darwin
. Is there a fix to this error?
p-avital commented
Hi there,
Which version of rust are you using?
The nightly channel currently requires additional blinds with the unstable core::marker::Freeze
trait to compile. I haven't pushed those to master yet, but will do so soon :)
If you're using a stable version of rust, that's much more worrying...
segeljakt commented
Oh, hmm, sorry for some reason cargo was running on nightly even though I did rustup default stable
. After uninstalling nightly it seems to work. Thanks for the help! :)