The Fuchsia guys use the trait system to enforce a global mutex locking order, which can statically prevent deadlocks due to two threads locking mutexes that they are both waiting for.
Doesn't help in this case, but it does suggest that we might be able to do better.
Any chance you could dig up a link to that code? I’m curious to learn more
https://lwn.net/Articles/995814/