diff options
| author | bors <bors@rust-lang.org> | 2022-06-22 08:07:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-22 08:07:46 +0000 |
| commit | 89a0783f1c8fef46b1c8de57dc611a1d753bf0d5 (patch) | |
| tree | b5bc0da449b017293c90ec93cd34fcf7cd5470b0 /compiler/rustc_data_structures/src | |
| parent | 3d829a0922d865d7a77fb284424fd8ba6afaea3b (diff) | |
| parent | db64923b800686132139168124891d58b66a2a98 (diff) | |
| download | rust-89a0783f1c8fef46b1c8de57dc611a1d753bf0d5.tar.gz rust-89a0783f1c8fef46b1c8de57dc611a1d753bf0d5.zip | |
Auto merge of #98375 - JohnTitor:rollup-e5c6rgo, r=JohnTitor
Rollup of 10 pull requests Successful merges: - #95446 (update CPU usage script) - #96768 (Use futex based thread parker on Fuchsia.) - #97454 (Add release notes for 1.62) - #97516 (clarify how Rust atomics correspond to C++ atomics) - #97818 (Point at return expression for RPIT-related error) - #97895 (Simplify `likely!` and `unlikely!` macro) - #98005 (Add some tests for impossible bounds) - #98226 (Document unstable `--extern` options) - #98356 (Add missing period) - #98363 (remove use of &Alloc in btree tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/lib.rs | 21 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/profiling.rs | 3 |
2 files changed, 2 insertions, 22 deletions
diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 0d072046d58..390a44d3f33 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -11,7 +11,6 @@ #![feature(associated_type_bounds)] #![feature(auto_traits)] #![feature(control_flow_enum)] -#![feature(core_intrinsics)] #![feature(extend_one)] #![feature(let_else)] #![feature(hash_raw_entry)] @@ -44,26 +43,6 @@ pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R { f() } -#[macro_export] -macro_rules! likely { - ($e:expr) => { - match $e { - #[allow(unused_unsafe)] - e => unsafe { std::intrinsics::likely(e) }, - } - }; -} - -#[macro_export] -macro_rules! unlikely { - ($e:expr) => { - match $e { - #[allow(unused_unsafe)] - e => unsafe { std::intrinsics::unlikely(e) }, - } - }; -} - pub mod base_n; pub mod binary_search_util; pub mod captures; diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs index a1f42d8d3c0..88ff33b4d09 100644 --- a/compiler/rustc_data_structures/src/profiling.rs +++ b/compiler/rustc_data_structures/src/profiling.rs @@ -195,6 +195,7 @@ impl SelfProfilerRef { F: for<'a> FnOnce(&'a SelfProfiler) -> TimingGuard<'a>, { #[inline(never)] + #[cold] fn cold_call<F>(profiler_ref: &SelfProfilerRef, f: F) -> TimingGuard<'_> where F: for<'a> FnOnce(&'a SelfProfiler) -> TimingGuard<'a>, @@ -203,7 +204,7 @@ impl SelfProfilerRef { f(&**profiler) } - if unlikely!(self.event_filter_mask.contains(event_filter)) { + if self.event_filter_mask.contains(event_filter) { cold_call(self, f) } else { TimingGuard::none() |
