diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2024-02-17 05:17:43 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2024-02-17 05:17:43 +0000 |
| commit | d523cab910d6b89b01dad9b283a67fb2256bc41e (patch) | |
| tree | 4bdb17aaad138aa83a9464e32a25528bd360f020 /compiler/rustc_query_impl/src | |
| parent | 63240d758b0a6d48a8ea24799230ae2c47540fdd (diff) | |
| parent | 4316d0c6252cb1f833e582dfa68adb98efd5ddfb (diff) | |
| download | rust-d523cab910d6b89b01dad9b283a67fb2256bc41e.tar.gz rust-d523cab910d6b89b01dad9b283a67fb2256bc41e.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_query_impl/src')
| -rw-r--r-- | compiler/rustc_query_impl/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index 0fe5b9c664a..33116737a42 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -3,6 +3,7 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(rust_logo)] #![feature(rustdoc_internals)] +#![feature(generic_nonzero)] #![feature(min_specialization)] #![feature(rustc_attrs)] #![allow(rustc::potential_query_instability, unused_parens)] diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index a827717d9bb..5917d79983d 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -30,7 +30,7 @@ use rustc_serialize::Decodable; use rustc_serialize::Encodable; use rustc_session::Limit; use rustc_span::def_id::LOCAL_CRATE; -use std::num::NonZeroU64; +use std::num::NonZero; use thin_vec::ThinVec; #[derive(Copy, Clone)] @@ -68,10 +68,8 @@ impl QueryContext for QueryCtxt<'_> { #[inline] fn next_job_id(self) -> QueryJobId { QueryJobId( - NonZeroU64::new( - self.query_system.jobs.fetch_add(1, std::sync::atomic::Ordering::Relaxed), - ) - .unwrap(), + NonZero::new(self.query_system.jobs.fetch_add(1, std::sync::atomic::Ordering::Relaxed)) + .unwrap(), ) } |
