I was reading The Rustonomicon, and came across its section on poisoning. One written example of type poisoning is when a "Mutex will poison itself if one of its MutexGuards (the thing it returns when a lock is obtained) is dropped during a panic." (Rustonomicon, section 7.2, paragraph 3)
I'm pretty out of my depth, but suddenly very curious.
In an effort to find an implemented demonstration of type poisoning, Googling "how to poison a type" yields useless results ranging from lists of chemical poison types, to Pokemon. "Code example of type poisoning" is much the same result.
Is there someone who can demonstrate type poisoning with a code snippet? I don't care if the example is in Rust or not, but maybe that's important... as in some languages can only be poisoned in certain ways maybe?
I see that poisoning happens in other languages, or at least C++ function poisoning, and namespace poisoning. (searching for "Java type poisoning" yields useless but interesting results from detecting java bean poisoned dogs, to how to poison mobs in Minecraft.)
And yet those examples lack links to examples in code. I was hoping to see it in action.