diff options
| author | onur-ozkan <work@onurozkan.dev> | 2025-05-27 18:28:46 +0300 | 
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2025-05-30 21:03:54 +0300 | 
| commit | 37cd39f3ce831afdfb4741474bdeefafda93bf6a (patch) | |
| tree | 35dc8ad8136b79ad71707ea664eb8060ab0cc3be /compiler/rustc_data_structures/src/profiling.rs | |
| parent | 613eceb80e9adceed4a80ca6cc838ffae3ccc78c (diff) | |
| download | rust-37cd39f3ce831afdfb4741474bdeefafda93bf6a.tar.gz rust-37cd39f3ce831afdfb4741474bdeefafda93bf6a.zip | |
handle cfg bootstrap on compiler and miri
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Diffstat (limited to 'compiler/rustc_data_structures/src/profiling.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/profiling.rs | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs index 36649a36070..e3a01e4035c 100644 --- a/compiler/rustc_data_structures/src/profiling.rs +++ b/compiler/rustc_data_structures/src/profiling.rs @@ -859,8 +859,19 @@ fn get_thread_id() -> u32 { std::thread::current().id().as_u64().get() as u32 } +// cfg(bootstrap) +macro_rules! cfg_select_dispatch { + ($($tokens:tt)*) => { + #[cfg(bootstrap)] + cfg_match! { $($tokens)* } + + #[cfg(not(bootstrap))] + cfg_select! { $($tokens)* } + }; +} + // Memory reporting -cfg_select! { +cfg_select_dispatch! { windows => { pub fn get_resident_set_size() -> Option<usize> { use windows::{ | 
