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

Bug: cargo check error due to unstable library feature lazy_cell #5199

Open
5 tasks done
cygnus-glacier opened this issue Nov 13, 2024 · 1 comment
Open
5 tasks done
Labels
bug Something isn't working

Comments

@cygnus-glacier
Copy link

cygnus-glacier commented Nov 13, 2024

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

I've been following the advice on Local Development to install lemmy as a local instance.
When trying to run cargo check it hits an error.
The Rust issue log for lazy_cell recommends installing rustup but it requires rust to be uninstalled first - so I haven't done that yet.
###Short version
cargo check

Checking lemmy_utils v0.19.6-beta.7 (/home/USER/lemmy/crates/utils)
error[E0658]: use of unstable library feature 'lazy_cell'

Full error is below.

Steps to Reproduce

  1. git clone https://github.com/LemmyNet/lemmy.git --recursive
  2. git clone https://github.com/LemmyNet/lemmy-ui.git --recursive
  3. cd lemmy
  4. cargo check

Technical Details

Full Error Message

cargo check
    Checking lemmy_utils v0.19.6-beta.7 (/home/USER/lemmy/crates/utils)
error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/rate_limit/rate_limiter.rs:6:3
  |
6 |   sync::LazyLock,
  |   ^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/rate_limit/rate_limiter.rs:12:20
   |
12 | static START_TIME: LazyLock<Instant> = LazyLock::new(Instant::now);
   |                    ^^^^^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/rate_limit/rate_limiter.rs:12:40
   |
12 | static START_TIME: LazyLock<Instant> = LazyLock::new(Instant::now);
   |                                        ^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/settings/mod.rs:5:31
  |
5 | use std::{env, fs, io::Error, sync::LazyLock};
  |                               ^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/settings/mod.rs:14:22
   |
14 | pub static SETTINGS: LazyLock<Settings> = LazyLock::new(|| {
   |                      ^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/settings/mod.rs:14:43
   |
14 | pub static SETTINGS: LazyLock<Settings> = LazyLock::new(|| {
   |                                           ^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/settings/mod.rs:26:25
   |
26 | static WEBFINGER_REGEX: LazyLock<Regex> = LazyLock::new(|| {
   |                         ^^^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/settings/mod.rs:26:43
   |
26 | static WEBFINGER_REGEX: LazyLock<Regex> = LazyLock::new(|| {
   |                                           ^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/markdown/mod.rs:4:5
  |
4 | use std::sync::LazyLock;
  |     ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/markdown/mod.rs:9:25
  |
9 | static MARKDOWN_PARSER: LazyLock<MarkdownIt> = LazyLock::new(|| {
  |                         ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/markdown/mod.rs:9:48
  |
9 | static MARKDOWN_PARSER: LazyLock<MarkdownIt> = LazyLock::new(|| {
  |                                                ^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/mention.rs:3:5
  |
3 | use std::sync::LazyLock;
  |     ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/mention.rs:5:24
  |
5 | static MENTIONS_REGEX: LazyLock<Regex> = LazyLock::new(|| {
  |                        ^^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/mention.rs:5:42
  |
5 | static MENTIONS_REGEX: LazyLock<Regex> = LazyLock::new(|| {
  |                                          ^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/validation.rs:5:5
  |
5 | use std::sync::LazyLock;
  |     ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/validation.rs:9:31
  |
9 | static VALID_MATRIX_ID_REGEX: LazyLock<Regex> = LazyLock::new(|| {
  |                               ^^^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/validation.rs:9:49
  |
9 | static VALID_MATRIX_ID_REGEX: LazyLock<Regex> = LazyLock::new(|| {
  |                                                 ^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/utils/validation.rs:14:21
   |
14 | static URL_CLEANER: LazyLock<UrlCleaner> =
   |                     ^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/utils/validation.rs:15:3
   |
15 |   LazyLock::new(|| UrlCleaner::from_embedded_rules().expect("compile cle...
   |   ^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/utils/validation.rs:91:34
   |
91 |   static VALID_ACTOR_NAME_REGEX: LazyLock<Regex> = LazyLock::new(|| {
   |                                  ^^^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/utils/validation.rs:91:52
   |
91 |   static VALID_ACTOR_NAME_REGEX: LazyLock<Regex> = LazyLock::new(|| {
   |                                                    ^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/rate_limit/rate_limiter.rs:12:40
   |
12 | static START_TIME: LazyLock<Instant> = LazyLock::new(Instant::now);
   |                                        ^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/settings/mod.rs:14:43
   |
14 | pub static SETTINGS: LazyLock<Settings> = LazyLock::new(|| {
   |                                           ^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/settings/mod.rs:26:43
   |
26 | static WEBFINGER_REGEX: LazyLock<Regex> = LazyLock::new(|| {
   |                                           ^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/markdown/mod.rs:9:48
  |
9 | static MARKDOWN_PARSER: LazyLock<MarkdownIt> = LazyLock::new(|| {
  |                                                ^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/mention.rs:5:42
  |
5 | static MENTIONS_REGEX: LazyLock<Regex> = LazyLock::new(|| {
  |                                          ^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
 --> crates/utils/src/utils/validation.rs:9:49
  |
9 | static VALID_MATRIX_ID_REGEX: LazyLock<Regex> = LazyLock::new(|| {
  |                                                 ^^^^^^^^^^^^^
  |
  = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/utils/validation.rs:15:3
   |
15 |   LazyLock::new(|| UrlCleaner::from_embedded_rules().expect("compile cle...
   |   ^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

error[E0658]: use of unstable library feature 'lazy_cell'
  --> crates/utils/src/utils/validation.rs:91:52
   |
91 |   static VALID_ACTOR_NAME_REGEX: LazyLock<Regex> = LazyLock::new(|| {
   |                                                    ^^^^^^^^^^^^^
   |
   = note: see issue #109736 <https://github.com/rust-lang/rust/issues/109736> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `lemmy_utils` (lib) due to 29 previous errors

Operating System Details

cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

Version

current from git (displayed in the footer of what?)

Lemmy Instance URL

local copy so no URL

@cygnus-glacier cygnus-glacier added the bug Something isn't working label Nov 13, 2024
@Nutomic
Copy link
Member

Nutomic commented Nov 13, 2024

Sounds like your Rust version is too old, try installing it from https://rustup.rs/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants