interprocess
interprocess copied to clipboard
No Mutex in `sync` error when using `interprocess` v1.2.1 with Tokio support
Describe the bug
Whenever I build with interprocess
(1.2.1) as a dependency without even using the dependency anywhere in the code, I get the following error:
Compiling tokio v1.36.0
Compiling interprocess v1.2.1
error[E0432]: unresolved import `tokio::sync::Mutex`
--> C:\Apps\Rust\cargo\registry\src\index.crates.io-6f17d22bba15001f\interprocess-1.2.1\src\os\windows\named_pipe\tokio\listener.rs:16:5
|
16 | tokio::sync::Mutex,
| ^^^^^^^^^^^^^^^^^^ no `Mutex` in `sync`
|
= help: consider importing one of these items instead:
spinning::Mutex
std::sync::Mutex
error[E0603]: module `sync` is private
--> C:\Apps\Rust\cargo\registry\src\index.crates.io-6f17d22bba15001f\interprocess-1.2.1\src\os\windows\named_pipe\tokio\listener.rs:16:12
|
16 | tokio::sync::Mutex,
| ^^^^ private module
|
note: the module `sync` is defined here
--> C:\Apps\Rust\cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.36.0\src\lib.rs:540:5
|
540 | mod sync;
| ^^^^^^^^
Some errors have detailed explanations: E0432, E0603.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `interprocess` (lib) due to 2 previous errors
To Reproduce
Simply add the following line in Cargo.toml
and build:
interprocess = { version = "1.2.1", features = ["tokio_support"] }
Expected behavior I expected the code to compile successfully.
Workaround I used the Git repo as the source, and the bug is fixed:
interprocess = { git = "https://github.com/kotauskas/interprocess", branch = "main", features = ["tokio"] }