未验证 提交 1f70776f 编写于 作者: T Tyler Mandry 提交者: GitHub

Rollup merge of #75587 - RalfJung:mir-comment-fixes, r=ecstatic-morse

mir building: fix some comments

r? @oli-obk

At least I hope these fixes are right, please double-check.^^
......@@ -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();
......@@ -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 {
......
......@@ -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
......
// 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
......
// 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
......
// 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
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册