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

EnumVariant/Enum<T>: Data race allowed on T #4090

Closed
wants to merge 1 commit into from

restrict Sync/Send for EnumVariant<T>

9d9cc8b
Select commit
Loading
Failed to load commit list.
Closed

EnumVariant/Enum<T>: Data race allowed on T #4090

restrict Sync/Send for EnumVariant<T>
9d9cc8b
Select commit
Loading
Failed to load commit list.
Cirrus CI / freebsd-13 failed Aug 3, 2023 in 12m 44s

Task Summary

Instruction build failed in 05:59

Details

✅ 00:53 clone
✅ 00:17 install_rust
✅ 04:43 getdeps
✅ 00:01 registry
✅ 00:45 target
✅ 00:01 before_cache
❌ 05:59 build

   Compiling serde_urlencoded v0.7.1
   Compiling reqwest v0.11.18
   Compiling wezterm v0.1.0 (/tmp/cirrus-ci-build/wezterm)
   Compiling libflate v2.0.0
   Compiling wezterm-mux-server v0.1.0 (/tmp/cirrus-ci-build/wezterm-mux-server)
   Compiling tar v0.4.39
   Compiling fuzzy-matcher v0.3.7
   Compiling wgpu v0.17.0
   Compiling pulldown-cmark v0.9.3
   Compiling clap_complete_fig v4.3.1
   Compiling frecency v0.1.0 (/tmp/cirrus-ci-build/frecency)
   Compiling http_req v0.9.2
   Compiling hdrhistogram v7.5.2
   Compiling emojis v0.6.0
   Compiling strip-ansi-escapes v0.1.0 (/tmp/cirrus-ci-build/strip-ansi-escapes)
   Compiling generate-bidi v0.1.0 (/tmp/cirrus-ci-build/bidi/generate)
   Compiling rcgen v0.9.3
   Compiling ssh2 v0.9.4
   Compiling mlua v0.9.0-rc.3
   Compiling libssh-rs v0.2.0
   Compiling wezterm-ssh v0.4.0 (/tmp/cirrus-ci-build/wezterm-ssh)
   Compiling luahelper v0.1.0 (/tmp/cirrus-ci-build/luahelper)
error[E0277]: `T` cannot be sent between threads safely
    --> luahelper/src/enumctor.rs:186:60
     |
186  |                     let variant_ctor = lua.create_userdata(EnumVariant::<T>::new(field))?;
     |                                            --------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely
     |                                            |
     |                                            required by a bound introduced by this call
     |
note: required for `EnumVariant<T>` to implement `Send`
    --> luahelper/src/enumctor.rs:17:22
     |
17   | unsafe impl<T: Send> Send for EnumVariant<T> {}
     |                ----  ^^^^     ^^^^^^^^^^^^^^
     |                |
     |                unsatisfied trait bound introduced here
     = note: required for `EnumVariant<T>` to implement `mlua::types::MaybeSend`
note: required by a bound in `Lua::create_userdata`
    --> /.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.9.0-rc.3/src/lua.rs:1723:23
     |
1721 |     pub fn create_userdata<T>(&self, data: T) -> Result<AnyUserData>
     |            --------------- required by a bound in this associated function
1722 |     where
1723 |         T: UserData + MaybeSend + 'static,
     |                       ^^^^^^^^^ required by this bound in `Lua::create_userdata`
help: consider further restricting this bound
     |
114  |     T: FromDynamic + std::marker::Send,
     |                    +++++++++++++++++++

For more information about this error, try `rustc --explain E0277`.
error: could not compile `luahelper` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

Exit status: 101