Skip to content

std::cell::RefCell<regex::exec::ProgramCacheInner> can't be shared between threads #667

Closed
@sophiajt

Description

@sophiajt

Apologies if this is documented and I missed it. I'm currently working with regex in some async stream work, and came across this error:

error[E0277]: `std::cell::RefCell<regex::exec::ProgramCacheInner>` cannot be shared between threads safely
   --> crates/nu-cli/src/commands/parse.rs:155:15
    |
155 |     Ok(stream.to_output_stream())
    |               ^^^^^^^^^^^^^^^^ `std::cell::RefCell<regex::exec::ProgramCacheInner>` cannot be shared between threads safely
    |
    = help: the trait `std::marker::Sync` is not implemented for `std::cell::RefCell<regex::exec::ProgramCacheInner>`

Is it possible to run regex in a mode that won't trip over the RefCell for the inner cache, by chance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions