Skip to content

Compilation fails with thread safety errors in arena.rs #2749

@younes-io

Description

@younes-io

When using scryer-prolog as a dependency with default-features = false, compilation fails with thread safety errors in arena.rs. The error occurs with Rust 1.83.0.

error[E0277]: `*const u8` cannot be shared between threads safely
   --> src/arena.rs:67:31
    |
67  |     static GLOBAL_ATOM_TABLE: RwLock<Weak<F64Table>> = RwLock::new(Weak::new());
    |                               ^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be shared between threads safely

Reproduction:

  1. Create new Rust project
  2. Add dependency:
[dependencies.scryer-prolog]
default-features = false
git = "https://github.com/mthom/scryer-prolog"
branch = "master"
  1. Run cargo build

Environment:

  • Rust: 1.83.0
  • OS: Ubuntu 22.04
  • Architecture: x86_64

Is this normal? What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions