about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-12-23 12:54:54 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2020-01-06 10:56:13 -0500
commitd9a7db901e33940cb2ccda6afe21b9916e66d9d2 (patch)
tree137ba223e01c2eba567ce35e1e3374957a2c0e08 /src/rustllvm/PassWrapper.cpp
parenta80e63f3fa77792e848e3b248acf4c0acda2e310 (diff)
downloadrust-d9a7db901e33940cb2ccda6afe21b9916e66d9d2.tar.gz
rust-d9a7db901e33940cb2ccda6afe21b9916e66d9d2.zip
Add an unstable conversion from thread ID to u64
We see multiple cases inside rustc and ecosystem code where ThreadId is
transmuted to u64, exploiting the underlying detail. This is suboptimal
(can break unexpectedly if we change things in std).

It is unlikely that ThreadId will ever need to be larger than u64 --
creating even 2^32 threads over the course of a program is quite hard,
2^64 is even harder. As such, we do not choose to return a larger sized
type (e.g. u128). If we choose to shrink ThreadId in the future, or
otherwise change its internals, it is likely that a mapping to u64 will
still be applicable (though may become more complex).
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions