Skip to content

Commit

Permalink
Address nits
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobDegen committed Apr 16, 2022
1 parent 699bf7d commit 4534188
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/pass_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub fn run_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>, passes: &[&dyn

let validate = tcx.sess.opts.debugging_opts.validate_mir;
let overridden_passes = &tcx.sess.opts.debugging_opts.mir_enable_passes;
trace!("Overridden: {:?}", overridden_passes);
trace!(?overridden_passes);

if validate {
validate_body(tcx, body, format!("start of phase transition from {:?}", start_phase));
Expand All @@ -89,9 +89,9 @@ pub fn run_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>, passes: &[&dyn

if let Some((_, polarity)) = overridden_passes.iter().rev().find(|(s, _)| s == &*name) {
trace!(
"{} {} as requested by flag",
pass = %name,
"{} as requested by flag",
if *polarity { "Running" } else { "Not running" },
name
);
if !polarity {
continue;
Expand Down
7 changes: 2 additions & 5 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,8 @@ mod parse {
match v {
Some(s) => {
for s in s.split(",") {
match s.chars().next() {
Some('+') => slot.push((s[1..].to_string(), true)),
Some('-') => slot.push((s[1..].to_string(), false)),
_ => return false,
}
let Some(pass_name) = s.strip_prefix(&['+', '-'][..]) else { return false };
slot.push((pass_name.to_string(), &s[..1] == "+"));
}
true
}
Expand Down

0 comments on commit 4534188

Please sign in to comment.