Location (URL)
https://doc.rust-lang.org/std/thread/struct.LocalKey.html#method.try_with
Summary
Currently it says:
If the key has been destroyed (which may happen if this is called in a destructor), this function will return an AccessError.
However I think it should say: "If the key has been destroyed (which may happen if this is called in a destructor), this function may return an AccessError."
Let me explain why I think this would be the correct documentation:
- LocalKey::with clearly documents that it does not always panic when the destructor has run and it uses LocalKey::try_with internally. If
LocalKey::try_with really did detect all destroyed thread locals, then LocalKey::with could always guaratee a panic.
- The top level
LocalKey docs seem to explain why previously destroyed thread locals would not always be possible to detect:
On all platforms it’s possible for TLS to re-initialize other TLS slots during destruction.
It could be that I came to the wrong conclusion, but there is at least some inconsistency in the docs here.
Location (URL)
https://doc.rust-lang.org/std/thread/struct.LocalKey.html#method.try_with
Summary
Currently it says:
However I think it should say: "If the key has been destroyed (which may happen if this is called in a destructor), this function may return an
AccessError."Let me explain why I think this would be the correct documentation:
LocalKey::try_withreally did detect all destroyed thread locals, thenLocalKey::withcould always guaratee a panic.LocalKeydocs seem to explain why previously destroyed thread locals would not always be possible to detect:It could be that I came to the wrong conclusion, but there is at least some inconsistency in the docs here.