XAMPPRocky / fluent-templates

Easily add Fluent to your Rust project.
Apache License 2.0
137 stars 29 forks source link

Compile error on mac regarding sharing Cell between threads #19

Closed wyattjsmith1 closed 4 years ago

wyattjsmith1 commented 4 years ago

Hi, if I pull the latest version of the app (fluent-templates = "0.5.12"), I get a compile error:

/Users/wys/.cargo/bin/cargo test --color=always --no-run --package dialog --lib i18n::test
   Compiling fluent v0.12.0
   Compiling fluent-template-macros v0.5.9
error[E0277]: `std::cell::Cell<bool>` cannot be shared between threads safely
   --> /Users/wys/.cargo/registry/src/github.com-1ecc6299db9ec823/fluent-template-macros-0.5.9/src/lib.rs:125:9
    |
125 | /         Box::new(|result| {
126 | |             let tx = tx.clone();
127 | |             if let Ok(entry) = result {
128 | |                 if entry
...   |
138 | |             ignore::WalkState::Continue
139 | |         })
    | |__________^ `std::cell::Cell<bool>` cannot be shared between threads safely
    |
    = help: within `flume::Sender<std::string::String>`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<bool>`
    = note: required because it appears within the type `flume::Sender<std::string::String>`
    = note: required because of the requirements on the impl of `std::marker::Send` for `&flume::Sender<std::string::String>`
    = note: required because it appears within the type `[closure@/Users/wys/.cargo/registry/src/github.com-1ecc6299db9ec823/fluent-template-macros-0.5.9/src/lib.rs:125:18: 139:10 tx:&flume::Sender<std::string::String>]`
    = note: required for the cast to the object type `dyn std::ops::FnMut(std::result::Result<ignore::walk::DirEntry, ignore::Error>) -> ignore::walk::WalkState + std::marker::Send`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `fluent-template-macros`.

To learn more, run the command again with --verbose.

Process finished with exit code 101

This seems to be caused by the most recent commit: https://github.com/XAMPPRocky/fluent-templates/commit/f47d95ebf761ece50fc4b3c0656385a8612767e2

OS: Mac 10.15.6 rustc: 1.45.0

XAMPPRocky commented 4 years ago

Thank you for your issue! That commit actually fixes your problem. I will release 0.5.13 later today with that patch and it should work then.

XAMPPRocky commented 4 years ago

I've now released 0.5.13