diff options
| author | Wesley Wiser <wwiser@gmail.com> | 2020-01-24 21:35:21 -0500 |
|---|---|---|
| committer | Wesley Wiser <wwiser@gmail.com> | 2020-01-24 21:39:31 -0500 |
| commit | 2acf5a30bac39d6fd326b0d82b047b9e59b64692 (patch) | |
| tree | f5affbdf955cb83559f2e4ebce42c1de155ca725 /src | |
| parent | ea42b1c5b85f649728e3a3b334489bac6dce890a (diff) | |
| download | rust-2acf5a30bac39d6fd326b0d82b047b9e59b64692.tar.gz rust-2acf5a30bac39d6fd326b0d82b047b9e59b64692.zip | |
[self-profiler] Clean up `EventFilter`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_data_structures/profiling.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/librustc_data_structures/profiling.rs b/src/librustc_data_structures/profiling.rs index 35bc6e298ac..90f74328a1d 100644 --- a/src/librustc_data_structures/profiling.rs +++ b/src/librustc_data_structures/profiling.rs @@ -128,17 +128,13 @@ bitflags::bitflags! { Self::QUERY_PROVIDERS.bits | Self::QUERY_BLOCKED.bits | Self::INCR_CACHE_LOADS.bits; - - // empty() and none() aren't const-fns unfortunately - const NONE = 0; - const ALL = !Self::NONE.bits; } } // keep this in sync with the `-Z self-profile-events` help message in librustc_session/options.rs const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[ - ("none", EventFilter::NONE), - ("all", EventFilter::ALL), + ("none", EventFilter::empty()), + ("all", EventFilter::all()), ("default", EventFilter::DEFAULT), ("generic-activity", EventFilter::GENERIC_ACTIVITIES), ("query-provider", EventFilter::QUERY_PROVIDERS), @@ -180,7 +176,7 @@ impl SelfProfilerRef { // If there is no SelfProfiler then the filter mask is set to NONE, // ensuring that nothing ever tries to actually access it. let event_filter_mask = - profiler.as_ref().map(|p| p.event_filter_mask).unwrap_or(EventFilter::NONE); + profiler.as_ref().map(|p| p.event_filter_mask).unwrap_or(EventFilter::empty()); SelfProfilerRef { profiler, |
