@@ -90,42 +90,6 @@ pub fn maybe_dump_mir<'tcx, F>(
90
90
}
91
91
92
92
pub fn dump_mir < ' tcx , F > (
93
- tcx : TyCtxt < ' tcx > ,
94
- pass_num : Option < & dyn Display > ,
95
- pass_name : & str ,
96
- disambiguator : & dyn Display ,
97
- body : & Body < ' tcx > ,
98
- extra_data : F ,
99
- ) where
100
- F : FnMut ( PassWhere , & mut dyn Write ) -> io:: Result < ( ) > ,
101
- {
102
- // njn: inline this
103
- dump_matched_mir_node ( tcx, pass_num, pass_name, disambiguator, body, extra_data) ;
104
- }
105
-
106
- pub fn pass_name_matches_dump_filters < ' tcx > (
107
- tcx : TyCtxt < ' tcx > ,
108
- filters : & str ,
109
- pass_name : & str ,
110
- def_id : DefId ,
111
- ) -> bool {
112
- // see notes on #41697 below
113
- let node_path = ty:: print:: with_forced_impl_filename_line!( tcx. def_path_str( def_id) ) ;
114
- filters. split ( '|' ) . any ( |or_filter| {
115
- or_filter. split ( '&' ) . all ( |and_filter| {
116
- let and_filter_trimmed = and_filter. trim ( ) ;
117
- and_filter_trimmed == "all"
118
- || pass_name. contains ( and_filter_trimmed)
119
- || node_path. contains ( and_filter_trimmed)
120
- } )
121
- } )
122
- }
123
-
124
- // #41697 -- we use `with_forced_impl_filename_line()` because
125
- // `def_path_str()` would otherwise trigger `type_of`, and this can
126
- // run while we are already attempting to evaluate `type_of`.
127
-
128
- fn dump_matched_mir_node < ' tcx , F > (
129
93
tcx : TyCtxt < ' tcx > ,
130
94
pass_num : Option < & dyn Display > ,
131
95
pass_name : & str ,
@@ -135,6 +99,10 @@ fn dump_matched_mir_node<'tcx, F>(
135
99
) where
136
100
F : FnMut ( PassWhere , & mut dyn Write ) -> io:: Result < ( ) > ,
137
101
{
102
+ // #41697 -- we use `with_forced_impl_filename_line()` because
103
+ // `def_path_str()` would otherwise trigger `type_of`, and this can
104
+ // run while we are already attempting to evaluate `type_of`.
105
+
138
106
let _: io:: Result < ( ) > = try {
139
107
let mut file =
140
108
create_dump_file ( tcx, "mir" , pass_num, pass_name, disambiguator, body. source ) ?;
@@ -177,6 +145,24 @@ fn dump_matched_mir_node<'tcx, F>(
177
145
}
178
146
}
179
147
148
+ pub fn pass_name_matches_dump_filters < ' tcx > (
149
+ tcx : TyCtxt < ' tcx > ,
150
+ filters : & str ,
151
+ pass_name : & str ,
152
+ def_id : DefId ,
153
+ ) -> bool {
154
+ // see notes on #41697 below
155
+ let node_path = ty:: print:: with_forced_impl_filename_line!( tcx. def_path_str( def_id) ) ;
156
+ filters. split ( '|' ) . any ( |or_filter| {
157
+ or_filter. split ( '&' ) . all ( |and_filter| {
158
+ let and_filter_trimmed = and_filter. trim ( ) ;
159
+ and_filter_trimmed == "all"
160
+ || pass_name. contains ( and_filter_trimmed)
161
+ || node_path. contains ( and_filter_trimmed)
162
+ } )
163
+ } )
164
+ }
165
+
180
166
/// Returns the file basename portion (without extension) of a filename path
181
167
/// where we should dump a MIR representation output files.
182
168
fn dump_file_basename < ' tcx > (
0 commit comments