Skip to content

Commit 2acf5a3

Browse files
committed
[self-profiler] Clean up EventFilter
1 parent ea42b1c commit 2acf5a3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustc_data_structures/profiling.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,13 @@ bitflags::bitflags! {
128128
Self::QUERY_PROVIDERS.bits |
129129
Self::QUERY_BLOCKED.bits |
130130
Self::INCR_CACHE_LOADS.bits;
131-
132-
// empty() and none() aren't const-fns unfortunately
133-
const NONE = 0;
134-
const ALL = !Self::NONE.bits;
135131
}
136132
}
137133

138134
// keep this in sync with the `-Z self-profile-events` help message in librustc_session/options.rs
139135
const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
140-
("none", EventFilter::NONE),
141-
("all", EventFilter::ALL),
136+
("none", EventFilter::empty()),
137+
("all", EventFilter::all()),
142138
("default", EventFilter::DEFAULT),
143139
("generic-activity", EventFilter::GENERIC_ACTIVITIES),
144140
("query-provider", EventFilter::QUERY_PROVIDERS),
@@ -180,7 +176,7 @@ impl SelfProfilerRef {
180176
// If there is no SelfProfiler then the filter mask is set to NONE,
181177
// ensuring that nothing ever tries to actually access it.
182178
let event_filter_mask =
183-
profiler.as_ref().map(|p| p.event_filter_mask).unwrap_or(EventFilter::NONE);
179+
profiler.as_ref().map(|p| p.event_filter_mask).unwrap_or(EventFilter::empty());
184180

185181
SelfProfilerRef {
186182
profiler,

0 commit comments

Comments
 (0)