unsafe_token

Macro unsafe_token 

Source
macro_rules! unsafe_token {
    ($vis: vis $id: ident) => { ... };
    ($($vis: vis $id: ident),*) => { ... };
}
Expand description

Produces tokens whose only identifier is their type.

While unlikely, a potential misuse is constructing multiple instances of the same type and using one to access a cell constructed by another instance.

For example, if you have multiple instances of a tree that uses a single mutex to lock all of its Arc-ed nodes through a token built with unsafe_token, one’s token could unlock another’s node without causing any errors.