Skip to content

Commit

Permalink
Rollup merge of #85870 - ptrojahn:mir_dump_whitespace, r=davidtwco
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JohnTitor authored Jun 16, 2021
2 parents 9fef8d9 + d97824d commit 7030efb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_mir/src/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ pub fn dump_enabled<'tcx>(tcx: TyCtxt<'tcx>, pass_name: &str, def_id: DefId) ->
});
filters.split('|').any(|or_filter| {
or_filter.split('&').all(|and_filter| {
and_filter == "all" || pass_name.contains(and_filter) || node_path.contains(and_filter)
let and_filter_trimmed = and_filter.trim();
and_filter_trimmed == "all"
|| pass_name.contains(and_filter_trimmed)
|| node_path.contains(and_filter_trimmed)
})
})
}
Expand Down

0 comments on commit 7030efb

Please sign in to comment.