From 746a58d4359786e4aebb372a30829706fa5a968f Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 29 Jan 2024 23:59:09 +0100 Subject: Use generic `NonZero` internally. --- compiler/rustc_query_system/src/lib.rs | 1 + compiler/rustc_query_system/src/query/job.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_query_system') diff --git a/compiler/rustc_query_system/src/lib.rs b/compiler/rustc_query_system/src/lib.rs index 416f556f57d..6a959a99e5d 100644 --- a/compiler/rustc_query_system/src/lib.rs +++ b/compiler/rustc_query_system/src/lib.rs @@ -1,5 +1,6 @@ #![feature(assert_matches)] #![feature(core_intrinsics)] +#![feature(generic_nonzero)] #![feature(hash_raw_entry)] #![feature(min_specialization)] #![feature(let_chains)] diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs index 8d7c0ca0144..bf89bc7f7c3 100644 --- a/compiler/rustc_query_system/src/query/job.rs +++ b/compiler/rustc_query_system/src/query/job.rs @@ -11,7 +11,7 @@ use rustc_span::Span; use std::hash::Hash; use std::io::Write; -use std::num::NonZeroU64; +use std::num::NonZero; #[cfg(parallel_compiler)] use { @@ -36,7 +36,7 @@ pub type QueryMap = FxHashMap; /// A value uniquely identifying an active query job. #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] -pub struct QueryJobId(pub NonZeroU64); +pub struct QueryJobId(pub NonZero); impl QueryJobId { fn query(self, map: &QueryMap) -> QueryStackFrame { -- cgit 1.4.1-3-g733a5