mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
Return NonZeroU64 from ThreadId::as_u64.
As discussed in #67939, this allows turning Option<ThreadId> into Option<NonZeroU64> which can then be stored inside an AtomicU64.
This commit is contained in:
@@ -1082,8 +1082,8 @@ fn new() -> ThreadId {
|
||||
/// it is not guaranteed which values new threads will return, and this may
|
||||
/// change across Rust versions.
|
||||
#[unstable(feature = "thread_id_value", issue = "67939")]
|
||||
pub fn as_u64(&self) -> u64 {
|
||||
self.0.get()
|
||||
pub fn as_u64(&self) -> NonZeroU64 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user