Skip to content

Commit

Permalink
mir building: fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Aug 18, 2020
1 parent 4717cf2 commit 75d1373
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/librustc_mir/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ fn mir_validated(

// Ensure that we compute the `mir_const_qualif` for constants at
// this point, before we steal the mir-const result.
// Also this means promotion can rely on all const checks having been done.
let _ = tcx.mir_const_qualif_opt_const_arg(def);

let mut body = tcx.mir_const(def).steal();
Expand All @@ -336,7 +337,7 @@ fn mir_validated(
let promote: &[&dyn MirPass<'tcx>] = &[
// What we need to run borrowck etc.
&promote_pass,
&simplify::SimplifyCfg::new("qualify-consts"),
&simplify::SimplifyCfg::new("promote-consts"),
];

let opt_coverage: &[&dyn MirPass<'tcx>] = if tcx.sess.opts.debugging_opts.instrument_coverage {
Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/issue-41697.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait Foo {
}

// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR issue_41697.{{impl}}-{{constant}}.SimplifyCfg-qualify-consts.after.mir
// EMIT_MIR issue_41697.{{impl}}-{{constant}}.SimplifyCfg-promote-consts.after.mir
impl Foo for [u8; 1+1] {
fn get(&self) -> [u8; 2] {
*self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0` after SimplifyCfg-qualify-consts
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0` after SimplifyCfg-promote-consts

<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0: usize = {
let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0` after SimplifyCfg-qualify-consts
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0` after SimplifyCfg-promote-consts

<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0: usize = {
let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// MIR for `main` after SimplifyCfg-qualify-consts
// MIR for `main` after SimplifyCfg-promote-consts

fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/loop_test.rs:6:11: 6:11
Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/loop_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Tests to make sure we correctly generate falseUnwind edges in loops

// EMIT_MIR loop_test.main.SimplifyCfg-qualify-consts.after.mir
// EMIT_MIR loop_test.main.SimplifyCfg-promote-consts.after.mir
fn main() {
// Exit early at runtime. Since only care about the generated MIR
// and not the runtime behavior (which is exercised by other tests)
Expand Down

0 comments on commit 75d1373

Please sign in to comment.