Skip to content

Commit 7030efb

Browse files
authored
Rollup merge of #85870 - ptrojahn:mir_dump_whitespace, r=davidtwco
Allow whitespace in dump_mir filter At least on my system this is necessary to get more complex filters with spaces like in https://rustc-dev-guide.rust-lang.org/mir/debugging.html working.
2 parents 9fef8d9 + d97824d commit 7030efb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_mir/src/util/pretty.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ pub fn dump_enabled<'tcx>(tcx: TyCtxt<'tcx>, pass_name: &str, def_id: DefId) ->
9999
});
100100
filters.split('|').any(|or_filter| {
101101
or_filter.split('&').all(|and_filter| {
102-
and_filter == "all" || pass_name.contains(and_filter) || node_path.contains(and_filter)
102+
let and_filter_trimmed = and_filter.trim();
103+
and_filter_trimmed == "all"
104+
|| pass_name.contains(and_filter_trimmed)
105+
|| node_path.contains(and_filter_trimmed)
103106
})
104107
})
105108
}

0 commit comments

Comments
 (0)