[GH-ISSUE #346] error: Could not compile lazy_static. #230

Closed
opened 2026-02-27 19:29:32 +03:00 by kerem · 2 comments
Owner

Originally created by @mcNETDev on GitHub (Jul 7, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/346

Hi,
what am I doing wrong?
installation:

root@rpi301:/home/spot/librespot# curl https://sh.rustup.rs -sSf | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

  /root/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /root/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: armv7-unknown-linux-gnueabihf
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
1
Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done automatically.

To configure your current shell run source $HOME/.cargo/env
root@rpi301:/home/spot/librespot# source $HOME/.cargo/env
root@rpi301:/home/spot/librespot# cargo build --release
   Compiling quick-error v1.2.2
   Compiling cfg-if v0.1.7
   Compiling approx v0.1.1
   Compiling memchr v2.2.0
   Compiling proc-macro2 v0.4.29
   Compiling error-chain v0.11.0
   Compiling utf8-ranges v1.0.2
   Compiling ucd-util v0.1.3
   Compiling rustc-serialize v0.3.24
   Compiling hex v0.3.2
   Compiling try-lock v0.1.0
   Compiling linear-map v1.2.0
   Compiling itoa v0.4.4
   Compiling lazy_static v1.3.0
   Compiling smallvec v0.2.1
error: const fns are an unstable feature
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:20:33
   |
20 |     pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT);
   |                                 ^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add #![feature(const_fn)] to the crate attributes to enable

error[E0493]: constants are not allowed to have destructors
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:20:33
   |
20 |     pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT);
   |                                 ^^^^^^^^^^^^^^^ constants cannot have destructors

error[E0493]: constants are not allowed to have destructors
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:20:28
   |
20 |     pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT);
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constants cannot have destructors

error: aborting due to 3 previous errors

error: Could not compile "lazy_static".
warning: build failed, waiting for other jobs to finish...
error: build failed
Originally created by @mcNETDev on GitHub (Jul 7, 2019). Original GitHub issue: https://github.com/librespot-org/librespot/issues/346 Hi, what am I doing wrong? installation: ``` root@rpi301:/home/spot/librespot# curl https://sh.rustup.rs -sSf | sh info: downloading installer Welcome to Rust! This will download and install the official compiler for the Rust programming language, and its package manager, Cargo. It will add the cargo, rustc, rustup and other commands to Cargo's bin directory, located at: /root/.cargo/bin This path will then be added to your PATH environment variable by modifying the profile file located at: /root/.profile You can uninstall at any time with rustup self uninstall and these changes will be reverted. Current installation options: default host triple: armv7-unknown-linux-gnueabihf default toolchain: stable modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation 1 Rust is installed now. Great! To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH environment variable. Next time you log in this will be done automatically. To configure your current shell run source $HOME/.cargo/env root@rpi301:/home/spot/librespot# source $HOME/.cargo/env root@rpi301:/home/spot/librespot# cargo build --release Compiling quick-error v1.2.2 Compiling cfg-if v0.1.7 Compiling approx v0.1.1 Compiling memchr v2.2.0 Compiling proc-macro2 v0.4.29 Compiling error-chain v0.11.0 Compiling utf8-ranges v1.0.2 Compiling ucd-util v0.1.3 Compiling rustc-serialize v0.3.24 Compiling hex v0.3.2 Compiling try-lock v0.1.0 Compiling linear-map v1.2.0 Compiling itoa v0.4.4 Compiling lazy_static v1.3.0 Compiling smallvec v0.2.1 error: const fns are an unstable feature --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:20:33 | 20 | pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT); | ^^^^^^^^^^^^^^^ | = help: in Nightly builds, add #![feature(const_fn)] to the crate attributes to enable error[E0493]: constants are not allowed to have destructors --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:20:33 | 20 | pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT); | ^^^^^^^^^^^^^^^ constants cannot have destructors error[E0493]: constants are not allowed to have destructors --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:20:28 | 20 | pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constants cannot have destructors error: aborting due to 3 previous errors error: Could not compile "lazy_static". warning: build failed, waiting for other jobs to finish... error: build failed ```
kerem closed this issue 2026-02-27 19:29:33 +03:00
Author
Owner

@ashthespy commented on GitHub (Jul 7, 2019):

What version of Rust are you on?

rustup show
<!-- gh-comment-id:508995544 --> @ashthespy commented on GitHub (Jul 7, 2019): What version of Rust are you on? ``` rustup show ```
Author
Owner

@ashthespy commented on GitHub (Mar 20, 2020):

Closing this due to lack of activity..

<!-- gh-comment-id:601942141 --> @ashthespy commented on GitHub (Mar 20, 2020): Closing this due to lack of activity..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#230
No description provided.