diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2024-01-05 05:12:56 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2024-01-05 05:12:56 +0000 |
| commit | d11a2bdc1de415c16fd9cbf886aecf22f9cc4a4a (patch) | |
| tree | 4b530857b40a0aaf12b8855289f5a65cd7d8eb73 /compiler/rustc_data_structures/src | |
| parent | 4c4c6a6de31e1018e718fd68616b4fa989457230 (diff) | |
| parent | a59a98024e3fe317e37e218392f5c34e932b2394 (diff) | |
| download | rust-d11a2bdc1de415c16fd9cbf886aecf22f9cc4a4a.tar.gz rust-d11a2bdc1de415c16fd9cbf886aecf22f9cc4a4a.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/hashes.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/lib.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/profiling.rs | 15 |
3 files changed, 20 insertions, 8 deletions
diff --git a/compiler/rustc_data_structures/src/hashes.rs b/compiler/rustc_data_structures/src/hashes.rs index ad068cdbc98..291ee5bbe26 100644 --- a/compiler/rustc_data_structures/src/hashes.rs +++ b/compiler/rustc_data_structures/src/hashes.rs @@ -25,7 +25,7 @@ impl Hash64 { pub const ZERO: Hash64 = Hash64 { inner: 0 }; #[inline] - pub(crate) fn new(n: u64) -> Self { + pub fn new(n: u64) -> Self { Self { inner: n } } diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 3ef87684fa5..93b4032c310 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -150,3 +150,14 @@ pub fn make_display(f: impl Fn(&mut fmt::Formatter<'_>) -> fmt::Result) -> impl // See comments in src/librustc_middle/lib.rs #[doc(hidden)] pub fn __noop_fix_for_27438() {} + +#[macro_export] +macro_rules! external_bitflags_debug { + ($Name:ident) => { + impl ::std::fmt::Debug for $Name { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::bitflags::parser::to_writer(self, f) + } + } + }; +} diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs index ef7375a7320..e29d4811980 100644 --- a/compiler/rustc_data_structures/src/profiling.rs +++ b/compiler/rustc_data_structures/src/profiling.rs @@ -101,6 +101,7 @@ use parking_lot::RwLock; use smallvec::SmallVec; bitflags::bitflags! { + #[derive(Clone, Copy)] struct EventFilter: u16 { const GENERIC_ACTIVITIES = 1 << 0; const QUERY_PROVIDERS = 1 << 1; @@ -114,14 +115,14 @@ bitflags::bitflags! { const INCR_RESULT_HASHING = 1 << 8; const ARTIFACT_SIZES = 1 << 9; - const DEFAULT = Self::GENERIC_ACTIVITIES.bits | - Self::QUERY_PROVIDERS.bits | - Self::QUERY_BLOCKED.bits | - Self::INCR_CACHE_LOADS.bits | - Self::INCR_RESULT_HASHING.bits | - Self::ARTIFACT_SIZES.bits; + const DEFAULT = Self::GENERIC_ACTIVITIES.bits() | + Self::QUERY_PROVIDERS.bits() | + Self::QUERY_BLOCKED.bits() | + Self::INCR_CACHE_LOADS.bits() | + Self::INCR_RESULT_HASHING.bits() | + Self::ARTIFACT_SIZES.bits(); - const ARGS = Self::QUERY_KEYS.bits | Self::FUNCTION_ARGS.bits; + const ARGS = Self::QUERY_KEYS.bits() | Self::FUNCTION_ARGS.bits(); } } |
