diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-11-06 15:56:29 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-11-06 15:56:29 +0100 |
| commit | a3776d99ccdd60d3f880005e4fe4e9478768ea41 (patch) | |
| tree | 2ae44228da373335cb61e3ad4955cb27567518c5 | |
| parent | c4ff03f689c03d73d3a8af49611b1f2b54d6a300 (diff) | |
| download | rust-a3776d99ccdd60d3f880005e4fe4e9478768ea41.tar.gz rust-a3776d99ccdd60d3f880005e4fe4e9478768ea41.zip | |
Run reveal_all on MIR more often.
| -rw-r--r-- | compiler/rustc_mir_transform/src/reveal_all.rs | 2 | ||||
| -rw-r--r-- | src/test/mir-opt/issue-78192.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/reveal_all.rs b/compiler/rustc_mir_transform/src/reveal_all.rs index 7b4eb4912cb..6c423a2bb57 100644 --- a/compiler/rustc_mir_transform/src/reveal_all.rs +++ b/compiler/rustc_mir_transform/src/reveal_all.rs @@ -11,7 +11,7 @@ impl<'tcx> MirPass<'tcx> for RevealAll { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { // This pass must run before inlining, since we insert callee bodies in RevealAll mode. // Do not apply this transformation to generators. - if (tcx.sess.mir_opt_level() >= 3 || !super::inline::is_enabled(tcx)) + if (tcx.sess.mir_opt_level() >= 3 || super::inline::is_enabled(tcx)) && body.generator.is_none() { let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id()); diff --git a/src/test/mir-opt/issue-78192.rs b/src/test/mir-opt/issue-78192.rs index 906d094f72b..39f665402b0 100644 --- a/src/test/mir-opt/issue-78192.rs +++ b/src/test/mir-opt/issue-78192.rs @@ -1,4 +1,4 @@ -// EMIT_MIR issue_78192.f.InstCombine.diff +// compile-flags: -Zmir-opt-level=1 -Zinline-mir pub fn f<T>(a: &T) -> *const T { let b: &*const T = &(a as *const T); *b @@ -7,3 +7,5 @@ pub fn f<T>(a: &T) -> *const T { fn main() { f(&2); } + +// EMIT_MIR issue_78192.f.InstCombine.diff |
