I'm having trouble with an in-progress crate that only uses tokio::sync::mutex, but fails to mock a trait containing the tokio version of Mutex, claiming that the std version is being used. I've created a repo with a minimum example that shows the failure to compile, despite the entire crate not having a single reference to std::sync::Mutex. Is anyone familiar with this, or is it a bug as I suspect?
What do you get when you ask cargo to expand the mockall macro?
I'm guessing that mockall uses a Mutex for something internally and that it generates an import that shadows the import of the Tokio Mutex. So it's probably a bug.
I didn't see the std::sync::Mutex as part of the prelude, but maybe I didn't dig deep enough. The author confirmed the issue and workaround (explictly mocking using tokio::sync::Mutex), and the rest of my issue is likely just my lack of mockall knowledge.