Skip to content

Commit e3365c2

Browse files
move #[allow(dead_code)] to the specific OpFilter variants that are never constructred
Signed-off-by: Tomas Fabrizio Orsi <[email protected]>
1 parent c94e30b commit e3365c2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

hir/src/pass.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,21 @@ enum SelectedPasses {
5656
Just(SmallVec<[String; 1]>),
5757
}
5858

59-
#[allow(dead_code)]
6059
#[derive(Default, Debug)]
6160
enum OpFilter {
6261
/// Print all operations
6362
#[default]
6463
All,
6564
/// Print any `Symbol` operation, optionally filtering by symbols whose name contains a given
6665
/// string.
66+
/// NOTE: Currently marked as `dead_code` since it is not configured via the CLI. See
67+
/// [`Print::with_symbol_filter`] for more details.
68+
#[allow(dead_code)]
6769
Symbol(Option<&'static str>),
6870
/// Print only operations of the given type
71+
/// NOTE: Currently marked as `dead_code` since it is not configured via the CLI. See
72+
/// [`Print::with_symbol_filter`] for more details.
73+
#[allow(dead_code)]
6974
Type {
7075
dialect: crate::interner::Symbol,
7176
op: crate::interner::Symbol,
@@ -99,10 +104,12 @@ impl Print {
99104
self
100105
}
101106

102-
#[allow(unused_mut)]
103-
fn with_symbol_filter(mut self, _config: &IRPrintingConfig) -> Self {
104-
// NOTE: At the moment, symbol filtering is not processed by the CLI. However, were it to be
105-
// added, it could be done inside this function
107+
/// Configure which operations are printed. This is set via the different variants present in
108+
/// [`OpFilter`].
109+
///
110+
/// NOTE: At the moment, all operations are shown because symbol filtering is not processed by
111+
/// the CLI. If added, this function could be expanded to process it.
112+
fn with_symbol_filter(self, _config: &IRPrintingConfig) -> Self {
106113
self.with_all_symbols()
107114
}
108115

0 commit comments

Comments
 (0)