Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mir building: fix some comments #75587

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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