Skip to content

Is it possible to use this with lazy_static? #46

@messense

Description

@messense

Can't get it compile.

error[E0277]: the trait bound `*mut onig_sys::OnigRegexType: std::marker::Sync` is not satisfied in `onig::Regex`
  --> src/lib.rs:14:1
   |
14 | / lazy_static! {
15 | |     static ref ROLES_FIND_RE: Regex = {
16 | |         let mut roles: Vec<String> = include_str!("../litigant/data/roles.txt")
17 | |             .lines()
...  |
52 | |     static ref ENDSWITH_COMPANY_RE: Regex = Regex::new("company$").unwrap();
53 | | }
   | |_^ `*mut onig_sys::OnigRegexType` cannot be shared between threads safely
   |
   = help: within `onig::Regex`, the trait `std::marker::Sync` is not implemented for `*mut onig_sys::OnigRegexType`
   = note: required because it appears within the type `onig::Regex`
   = note: required by `lazy_static::lazy::Lazy`
   = note: this error originates in a macro outside of the current crate

onig version: 1.4.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions