For a C++ programmer, the related "suprising" equivalent is to not name the variable. We had a regex linter in our code to ensure locks were named because of bugs from this.
You mean like `clippy::let_underscore_lock`? I'd like it if there was an annotation for arbitrary types to declare that they behave like a lock so that the lint would pick them up too.
For Rust, yes, we do have that and that'd be great to generalize it. That was a C++ code base using custom lock types that I used a regex linter for. Glad to not be touching it anymore for many reasons.